use of org.apache.spark.ml.regression.RandomForestRegressionModel in project jpmml-sparkml by jpmml.
the class RandomForestRegressionModelConverter method encodeModel.
@Override
public MiningModel encodeModel(Schema schema) {
RandomForestRegressionModel model = getTransformer();
List<TreeModel> treeModels = TreeModelUtil.encodeDecisionTreeEnsemble(model, schema);
MiningModel miningModel = new MiningModel(MiningFunction.REGRESSION, ModelUtil.createMiningSchema(schema.getLabel())).setSegmentation(MiningModelUtil.createSegmentation(Segmentation.MultipleModelMethod.AVERAGE, treeModels));
return miningModel;
}
Aggregations