use of org.knime.base.node.mine.treeensemble.model.TreeEnsembleModel in project knime-core by knime.
the class TreeEnsembleShrinker method getModel.
/**
* Returns the shrunk tree ensemble model.
*
* Note: If autoShrink() or shrinkTo() have not been called yet the model will contain the same trees as the initial model.
*
* @return The tree ensemble model
*/
public TreeEnsembleModel getModel() {
// Build a model based on the meta data of our initial model and the currently selected trees
TreeEnsembleLearnerConfiguration config = new TreeEnsembleLearnerConfiguration(false);
config.setSaveTargetDistributionInNodes(true);
return new TreeEnsembleModel(config, m_initialEnsemble.getMetaData(), m_currentTrees.toArray(new AbstractTreeModel[m_currentTrees.size()]), TreeType.Ordinary);
}
Aggregations