[英]I'm new to spark,trying to generate the decision tree model in scala and use that model in java to predict.How to load that model in java?
i have saved the model generated in scala to disc. 我已经将在scala中生成的模型保存到光盘中。
val model = DecisionTree.trainClassifier(trainingData, numClasses, categoricalFeaturesInfo, impurity, maxDepth, maxBins) model.save(sc, "C:\\Model") val模型= DecisionTree.trainClassifier(trainingData,numClasses,categoricalFeaturesInfo,杂质,maxDepth,maxBins)model.save(sc,“ C:\\ Model”)
对Java使用相同的导入以加载模型:
DecisionTreeModel model = DecisionTreeModel.load(sc, "C:\\Model");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.