Search in sources :

Example 1 with RandomForestRegressionModel

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;
}
Also used : TreeModel(org.dmg.pmml.tree.TreeModel) RandomForestRegressionModel(org.apache.spark.ml.regression.RandomForestRegressionModel) MiningModel(org.dmg.pmml.mining.MiningModel)

Aggregations

RandomForestRegressionModel (org.apache.spark.ml.regression.RandomForestRegressionModel)1 MiningModel (org.dmg.pmml.mining.MiningModel)1 TreeModel (org.dmg.pmml.tree.TreeModel)1