Search in sources :

Example 11 with TreeEnsembleModel

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);
}
Also used : TreeEnsembleLearnerConfiguration(org.knime.base.node.mine.treeensemble.node.learner.TreeEnsembleLearnerConfiguration) TreeEnsembleModel(org.knime.base.node.mine.treeensemble.model.TreeEnsembleModel) AbstractTreeModel(org.knime.base.node.mine.treeensemble.model.AbstractTreeModel)

Aggregations

TreeEnsembleModel (org.knime.base.node.mine.treeensemble.model.TreeEnsembleModel)11 TreeEnsembleModelPortObject (org.knime.base.node.mine.treeensemble.model.TreeEnsembleModelPortObject)7 ExecutionException (java.util.concurrent.ExecutionException)5 BufferedDataTable (org.knime.core.node.BufferedDataTable)5 CanceledExecutionException (org.knime.core.node.CanceledExecutionException)5 ExecutionMonitor (org.knime.core.node.ExecutionMonitor)5 PortObject (org.knime.core.node.port.PortObject)5 IOException (java.io.IOException)4 TreeData (org.knime.base.node.mine.treeensemble.data.TreeData)4 TreeDataCreator (org.knime.base.node.mine.treeensemble.data.TreeDataCreator)4 TreeEnsembleLearner (org.knime.base.node.mine.treeensemble.learner.TreeEnsembleLearner)4 TreeEnsembleModelPortObjectSpec (org.knime.base.node.mine.treeensemble.model.TreeEnsembleModelPortObjectSpec)4 FilterLearnColumnRearranger (org.knime.base.node.mine.treeensemble.node.learner.TreeEnsembleLearnerConfiguration.FilterLearnColumnRearranger)4 TreeEnsemblePredictor (org.knime.base.node.mine.treeensemble.node.predictor.TreeEnsemblePredictor)4 DataCell (org.knime.core.data.DataCell)4 DataTableSpec (org.knime.core.data.DataTableSpec)4 ColumnRearranger (org.knime.core.data.container.ColumnRearranger)4 InvalidSettingsException (org.knime.core.node.InvalidSettingsException)4 FilterColumnRow (org.knime.base.data.filter.column.FilterColumnRow)2 PredictorRecord (org.knime.base.node.mine.treeensemble.data.PredictorRecord)2