Search in sources :

Example 1 with TreeNumericColumnMetaData

use of org.knime.base.node.mine.treeensemble2.data.TreeNumericColumnMetaData in project knime-core by knime.

the class LiteralConditionParser method handleSimplePredicate.

private TreeNodeColumnCondition handleSimplePredicate(final SimplePredicate simplePred, final boolean acceptsMissings) {
    String field = simplePred.getField();
    if (m_metaDataMapper.isNominal(field)) {
        NominalAttributeColumnHelper colHelper = m_metaDataMapper.getNominalColumnHelper(field);
        return new TreeNodeNominalCondition(colHelper.getMetaData(), colHelper.getRepresentation(simplePred.getValue()).getAssignedInteger(), acceptsMissings);
    } else {
        TreeNumericColumnMetaData metaData = m_metaDataMapper.getNumericColumnHelper(field).getMetaData();
        double value = Double.parseDouble(simplePred.getValue());
        return new TreeNodeNumericCondition(metaData, value, parseNumericOperator(simplePred.getOperator()), acceptsMissings);
    }
}
Also used : TreeNumericColumnMetaData(org.knime.base.node.mine.treeensemble2.data.TreeNumericColumnMetaData) TreeNodeNumericCondition(org.knime.base.node.mine.treeensemble2.model.TreeNodeNumericCondition) TreeNodeNominalCondition(org.knime.base.node.mine.treeensemble2.model.TreeNodeNominalCondition)

Aggregations

TreeNumericColumnMetaData (org.knime.base.node.mine.treeensemble2.data.TreeNumericColumnMetaData)1 TreeNodeNominalCondition (org.knime.base.node.mine.treeensemble2.model.TreeNodeNominalCondition)1 TreeNodeNumericCondition (org.knime.base.node.mine.treeensemble2.model.TreeNodeNumericCondition)1