use of org.kie.api.pmml.PMMLRequestData in project drools by kiegroup.
the class PMMLRuntimeInternalImplTest method evaluateWithPMMLContextListeners.
@Test
public void evaluateWithPMMLContextListeners() {
final PMMLRequestData requestData = getPMMLRequestData();
final List<PMMLStep> pmmlSteps = new ArrayList<>();
final PMMLContext pmmlContext = new PMMLContextImpl(requestData, Collections.singleton(getPMMLListener(pmmlSteps)));
pmmlRuntime.evaluate(modelMock, pmmlContext);
Arrays.stream(PMML_STEP.values()).forEach(pmml_step -> {
Optional<PMMLStep> retrieved = pmmlSteps.stream().filter(pmmlStep -> pmml_step.equals(((PMMLRuntimeStep) pmmlStep).getPmmlStep())).findFirst();
assertTrue(retrieved.isPresent());
commonValuateStep(retrieved.get(), pmml_step, modelMock, requestData);
});
}
use of org.kie.api.pmml.PMMLRequestData in project drools by kiegroup.
the class PMMLScorecardModelEvaluatorTest method commonEvaluate.
private void commonEvaluate(Map<String, Object> inputData) {
final PMMLRequestData pmmlRequestData = getPMMLRequestData(modelName, inputData);
PMMLContext pmmlContext = new PMMLContextImpl(pmmlRequestData);
commonEvaluate(pmmlContext);
}
use of org.kie.api.pmml.PMMLRequestData in project drools by kiegroup.
the class PMMLTreeModelEvaluatorTest method commonEvaluate.
private void commonEvaluate(String modelName, Map<String, Object> inputData, String expectedScore) {
final PMMLRequestData pmmlRequestData = getPMMLRequestData(modelName, inputData);
PMMLContext pmmlContext = new PMMLContextImpl(pmmlRequestData);
commonEvaluate(pmmlContext, expectedScore);
}
Aggregations