use of org.kie.pmml.api.enums.ARRAY_TYPE in project drools by kiegroup.
the class KiePMMLSimpleSetPredicateTest method evaluationStringNotIn.
@Test
public void evaluationStringNotIn() {
ARRAY_TYPE arrayType = ARRAY_TYPE.STRING;
List<Object> values = getObjects(arrayType, 1);
KiePMMLSimpleSetPredicate kiePMMLSimpleSetPredicate = getKiePMMLSimpleSetPredicate(values, arrayType, IN_NOTIN.NOT_IN);
assertFalse(kiePMMLSimpleSetPredicate.evaluation(values.get(0)));
assertTrue(kiePMMLSimpleSetPredicate.evaluation("NOT"));
}
use of org.kie.pmml.api.enums.ARRAY_TYPE in project drools by kiegroup.
the class KiePMMLSimpleSetPredicateTest method evaluationRealIn.
@Test
public void evaluationRealIn() {
ARRAY_TYPE arrayType = ARRAY_TYPE.REAL;
List<Object> values = getObjects(arrayType, 1);
KiePMMLSimpleSetPredicate kiePMMLSimpleSetPredicate = getKiePMMLSimpleSetPredicate(values, arrayType, IN_NOTIN.IN);
assertFalse(kiePMMLSimpleSetPredicate.evaluation("23.4"));
assertTrue(kiePMMLSimpleSetPredicate.evaluation(values.get(0)));
}
use of org.kie.pmml.api.enums.ARRAY_TYPE in project drools by kiegroup.
the class KiePMMLSimpleSetPredicateTest method evaluateStringNotIn.
@Test
public void evaluateStringNotIn() {
ARRAY_TYPE arrayType = ARRAY_TYPE.STRING;
List<Object> values = getObjects(arrayType, 4);
KiePMMLSimpleSetPredicate kiePMMLSimpleSetPredicate = getKiePMMLSimpleSetPredicate(values, arrayType, IN_NOTIN.NOT_IN);
Map<String, Object> inputData = new HashMap<>();
inputData.put("FAKE", "NOT");
assertFalse(kiePMMLSimpleSetPredicate.evaluate(inputData));
inputData.put(SIMPLE_SET_PREDICATE_NAME, values.get(0));
assertFalse(kiePMMLSimpleSetPredicate.evaluate(inputData));
inputData.put(SIMPLE_SET_PREDICATE_NAME, "NOT");
assertTrue(kiePMMLSimpleSetPredicate.evaluate(inputData));
}
use of org.kie.pmml.api.enums.ARRAY_TYPE in project drools by kiegroup.
the class KiePMMLSimpleSetPredicateTest method evaluationRealNotIn.
@Test
public void evaluationRealNotIn() {
ARRAY_TYPE arrayType = ARRAY_TYPE.REAL;
List<Object> values = getObjects(arrayType, 1);
KiePMMLSimpleSetPredicate kiePMMLSimpleSetPredicate = getKiePMMLSimpleSetPredicate(values, arrayType, IN_NOTIN.NOT_IN);
assertFalse(kiePMMLSimpleSetPredicate.evaluation(values.get(0)));
assertTrue(kiePMMLSimpleSetPredicate.evaluation("23.4"));
}
use of org.kie.pmml.api.enums.ARRAY_TYPE in project drools by kiegroup.
the class KiePMMLSimpleSetPredicateTest method evaluateIntIn.
@Test
public void evaluateIntIn() {
ARRAY_TYPE arrayType = ARRAY_TYPE.INT;
List<Object> values = getObjects(arrayType, 4);
KiePMMLSimpleSetPredicate kiePMMLSimpleSetPredicate = getKiePMMLSimpleSetPredicate(values, arrayType, IN_NOTIN.IN);
Map<String, Object> inputData = new HashMap<>();
inputData.put("FAKE", "234");
assertFalse(kiePMMLSimpleSetPredicate.evaluate(inputData));
inputData.put(SIMPLE_SET_PREDICATE_NAME, "432");
assertFalse(kiePMMLSimpleSetPredicate.evaluate(inputData));
inputData.put(SIMPLE_SET_PREDICATE_NAME, values.get(0));
assertTrue(kiePMMLSimpleSetPredicate.evaluate(inputData));
}
Aggregations