Guillaume Charhon created SPARK-5713:
----------------------------------------

             Summary: Support python serialization for RandomForest
                 Key: SPARK-5713
                 URL: https://issues.apache.org/jira/browse/SPARK-5713
             Project: Spark
          Issue Type: Improvement
          Components: MLlib
    Affects Versions: 1.2.0
         Environment: Tested on MacOS
            Reporter: Guillaume Charhon


I was trying to pickle a trained ramdom forest model. Unfortunately, it is 
impossible to serialize the model for future use. 

model = RandomForest.trainRegressor(trainingData, categoricalFeaturesInfo={}, 
numTrees=nb_tree,featureSubsetStrategy="auto", impurity='variance', 
maxDepth=depth)

output = open('model.ml', 'wb')
pickle.dump(model,output)

I am getting this error:
TypeError: can't pickle lock objects

I am using Spark 1.2.0. I have also tested Spark 1.2.1






--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to