更新时间:2022-12-18 09:46:34
一种保存模型的方法(在 Scala 中;但在 Python 中可能类似):
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()
另见相关问题
有关详细信息,请参阅 (ref)
For more details see (ref)