Search in sources :

Example 1 with Enum

use of org.dmg.pmml.SimplePredicateDocument.SimplePredicate.Operator.Enum in project knime-core by knime.

the class PMMLRuleTranslator method setOperator.

/**
 * Sets the operator of {@code pred} based on the properties of {@code simple.}
 *
 * @param pred An xml {@link SimplePredicate}.
 * @param simple A {@link PMMLSimplePredicate}.
 */
private void setOperator(final SimplePredicate pred, final PMMLSimplePredicate simple) {
    PMMLOperator x = simple.getOperator();
    Enum e = PMMLPredicateTranslator.getOperator(x);
    if (e == null) {
        throw new UnsupportedOperationException("Unknown operator: " + x);
    }
    pred.setOperator(e);
}
Also used : Enum(org.dmg.pmml.SimplePredicateDocument.SimplePredicate.Operator.Enum) PMMLOperator(org.knime.base.node.mine.decisiontree2.PMMLOperator)

Example 2 with Enum

use of org.dmg.pmml.SimplePredicateDocument.SimplePredicate.Operator.Enum in project knime-core by knime.

the class FromDecisionTreeNodeModel method setOperator.

/**
 * Sets the operator of {@code pred} based on the properties of {@code simple.}
 *
 * @param pred An xml {@link SimplePredicate}.
 * @param simple A {@link PMMLSimplePredicate}.
 */
private void setOperator(final SimplePredicate pred, final PMMLSimplePredicate simple) {
    PMMLOperator x = simple.getOperator();
    Enum e = PMMLPredicateTranslator.getOperator(x);
    if (e == null) {
        throw new UnsupportedOperationException("Unknown operator: " + x);
    }
    pred.setOperator(e);
}
Also used : Enum(org.dmg.pmml.SimplePredicateDocument.SimplePredicate.Operator.Enum) PMMLOperator(org.knime.base.node.mine.decisiontree2.PMMLOperator)

Aggregations

Enum (org.dmg.pmml.SimplePredicateDocument.SimplePredicate.Operator.Enum)2 PMMLOperator (org.knime.base.node.mine.decisiontree2.PMMLOperator)2