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