I\'m working with Spark 1.3.0 using PySpark and MLlib and I need to save and load my models. I use code like this (taken from the official documentation )
from p
One way to save a model (in Scala; but probably is similar in Python):
// persist model to HDFS
sc.parallelize(Seq(model), 1).saveAsObjectFile("linReg.model")
Saved model can then be loaded as:
val linRegModel = sc.objectFile[LinearRegressionModel]("linReg.model").first()
See also related question
For more details see (ref)