【发布时间】:2018-06-03 22:04:26
【问题描述】:
rf = RandomForestClassifier().setFeaturesCol("features").setLabelCol("label")
pipeline = Pipeline(stages=[tokenizer, hashingTF, idf, rf])
model = pipeline.fit(training)
model.save(sc, '<path_to_save>')
我正在尝试使用上面的代码保存模型文件。但是出现意外错误 -
TypeError: save() takes exactly 2 arguments (3 given)
我不明白这个错误。我只传递了 2 个参数,但仍然收到此错误。 有人知道吗?我在这里做错了什么?
【问题讨论】:
标签: pyspark random-forest apache-spark-ml