use of org.apache.spark.ml.tree.DecisionTreeModel in project jpmml-sparkml by jpmml.
the class TreeModelUtil method encodeDecisionTreeEnsemble.
public static <M extends Model<M> & TreeEnsembleModel<T>, T extends Model<T> & DecisionTreeModel> List<TreeModel> encodeDecisionTreeEnsemble(M model, PredicateManager predicateManager, Schema schema) {
Schema segmentSchema = schema.toAnonymousSchema();
List<TreeModel> treeModels = new ArrayList<>();
T[] trees = model.trees();
for (T tree : trees) {
TreeModel treeModel = encodeDecisionTree(tree, predicateManager, segmentSchema);
treeModels.add(treeModel);
}
return treeModels;
}
Aggregations