use of org.dmg.pmml.SimplePredicateDocument.SimplePredicate.Operator in project knime-core by knime.
the class TreeModelPMMLTranslator method setValuesFromPMMLSimplePredicate.
private static void setValuesFromPMMLSimplePredicate(final SimplePredicate to, final PMMLSimplePredicate from) {
to.setField(from.getSplitAttribute());
Operator.Enum operator;
final PMMLOperator op = from.getOperator();
switch(op) {
case EQUAL:
operator = Operator.EQUAL;
to.setValue(from.getThreshold());
break;
case GREATER_OR_EQUAL:
operator = Operator.GREATER_OR_EQUAL;
to.setValue(from.getThreshold());
break;
case GREATER_THAN:
operator = Operator.GREATER_THAN;
to.setValue(from.getThreshold());
break;
case IS_MISSING:
operator = Operator.IS_MISSING;
break;
case IS_NOT_MISSING:
operator = Operator.IS_NOT_MISSING;
break;
case LESS_OR_EQUAL:
operator = Operator.LESS_OR_EQUAL;
to.setValue(from.getThreshold());
break;
case LESS_THAN:
operator = Operator.LESS_THAN;
to.setValue(from.getThreshold());
break;
case NOT_EQUAL:
operator = Operator.NOT_EQUAL;
to.setValue(from.getThreshold());
break;
default:
throw new IllegalStateException("Unknown pmml operator \"" + op + "\".");
}
to.setOperator(operator);
}
use of org.dmg.pmml.SimplePredicateDocument.SimplePredicate.Operator in project knime-core by knime.
the class ConditionExporter method setValuesFromPMMLSimplePredicate.
private void setValuesFromPMMLSimplePredicate(final SimplePredicate to, final PMMLSimplePredicate from) {
to.setField(m_derivedFieldMapper.getDerivedFieldName(from.getSplitAttribute()));
Operator.Enum operator;
final PMMLOperator op = from.getOperator();
switch(op) {
case EQUAL:
operator = Operator.EQUAL;
to.setValue(from.getThreshold());
break;
case GREATER_OR_EQUAL:
operator = Operator.GREATER_OR_EQUAL;
to.setValue(from.getThreshold());
break;
case GREATER_THAN:
operator = Operator.GREATER_THAN;
to.setValue(from.getThreshold());
break;
case IS_MISSING:
operator = Operator.IS_MISSING;
break;
case IS_NOT_MISSING:
operator = Operator.IS_NOT_MISSING;
break;
case LESS_OR_EQUAL:
operator = Operator.LESS_OR_EQUAL;
to.setValue(from.getThreshold());
break;
case LESS_THAN:
operator = Operator.LESS_THAN;
to.setValue(from.getThreshold());
break;
case NOT_EQUAL:
operator = Operator.NOT_EQUAL;
to.setValue(from.getThreshold());
break;
default:
throw new IllegalStateException("Unknown pmml operator \"" + op + "\".");
}
to.setOperator(operator);
}
Aggregations