Search in sources :

Example 6 with AbstractTreeNodeSurrogateCondition

use of org.knime.base.node.mine.treeensemble2.model.AbstractTreeNodeSurrogateCondition in project knime-core by knime.

the class ConditionExporter method exportCondition.

void exportCondition(final TreeNodeCondition condition, final Node pmmlNode) {
    if (condition instanceof TreeNodeTrueCondition) {
        pmmlNode.addNewTrue();
    } else if (condition instanceof TreeNodeColumnCondition) {
        final TreeNodeColumnCondition colCondition = (TreeNodeColumnCondition) condition;
        exportColumnCondition(colCondition, pmmlNode);
    } else if (condition instanceof AbstractTreeNodeSurrogateCondition) {
        final AbstractTreeNodeSurrogateCondition surrogateCond = (AbstractTreeNodeSurrogateCondition) condition;
        setValuesFromPMMLCompoundPredicate(pmmlNode.addNewCompoundPredicate(), surrogateCond.toPMMLPredicate());
    } else {
        throw new IllegalStateException("Unsupported condition (not implemented): " + condition.getClass().getSimpleName());
    }
}
Also used : TreeNodeColumnCondition(org.knime.base.node.mine.treeensemble2.model.TreeNodeColumnCondition) TreeNodeTrueCondition(org.knime.base.node.mine.treeensemble2.model.TreeNodeTrueCondition) AbstractTreeNodeSurrogateCondition(org.knime.base.node.mine.treeensemble2.model.AbstractTreeNodeSurrogateCondition)

Aggregations

AbstractTreeNodeSurrogateCondition (org.knime.base.node.mine.treeensemble2.model.AbstractTreeNodeSurrogateCondition)4 TreeNodeColumnCondition (org.knime.base.node.mine.treeensemble2.model.TreeNodeColumnCondition)3 TreeNodeSurrogateOnlyDefDirCondition (org.knime.base.node.mine.treeensemble2.model.TreeNodeSurrogateOnlyDefDirCondition)3 ArrayList (java.util.ArrayList)2 BitSet (java.util.BitSet)2 TreeAttributeColumnData (org.knime.base.node.mine.treeensemble2.data.TreeAttributeColumnData)2 TreeNodeCondition (org.knime.base.node.mine.treeensemble2.model.TreeNodeCondition)2 TreeNodeSurrogateCondition (org.knime.base.node.mine.treeensemble2.model.TreeNodeSurrogateCondition)2 ScoreDistribution (org.dmg.pmml.ScoreDistributionDocument.ScoreDistribution)1 NominalValueRepresentation (org.knime.base.node.mine.treeensemble2.data.NominalValueRepresentation)1 DataMemberships (org.knime.base.node.mine.treeensemble2.data.memberships.DataMemberships)1 TreeNodeTrueCondition (org.knime.base.node.mine.treeensemble2.model.TreeNodeTrueCondition)1 TreeEnsembleLearnerConfiguration (org.knime.base.node.mine.treeensemble2.node.learner.TreeEnsembleLearnerConfiguration)1