Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pySpark: Save ML Model

Can someone please give an example of how you would save a ML model in pySpark?

For

ml.classification.LogisticRegressionModel

I try to use the following:

model.save("path")

but it does not seem to work.

like image 579
ml_0x Avatar asked Apr 13 '16 23:04

ml_0x


1 Answers

If I understand your question correctly, your method signature is incorrect.

According to the docs you also need to pass in your spark context.

Docs: https://spark.apache.org/docs/1.6.1/api/python/pyspark.mllib.html?highlight=save#pyspark.mllib.classification.LogisticRegressionModel.save

like image 142
vkuo Avatar answered Oct 10 '22 14:10

vkuo