use of org.kie.pmml.api.runtime.PMMLRuntime in project drools by kiegroup.
the class DMNKiePMMLTrustyInvocationEvaluator method getPMMLRuntimeFromDMNRuntimeKBWrappingIKB.
private PMMLRuntime getPMMLRuntimeFromDMNRuntimeKBWrappingIKB(DMNRuntimeKBWrappingIKB runtimeKB) {
String pmmlFilePath = documentResource.getSourcePath();
String pmmlFileName = pmmlFilePath.contains("/") ? pmmlFilePath.substring(pmmlFilePath.lastIndexOf('/') + 1) : pmmlFilePath;
PMMLRuntime toReturn = PMML_RUNTIME_FACTORY.getPMMLRuntimeFromFileNameModelNameAndKieBase(pmmlFileName, model, runtimeKB.getInternalKnowledgeBase());
if (!toReturn.getPMMLModel(model).isPresent()) {
File pmmlFile = getPMMLFile();
toReturn = PMML_RUNTIME_FACTORY.getPMMLRuntimeFromFile(pmmlFile);
}
return toReturn;
}
use of org.kie.pmml.api.runtime.PMMLRuntime in project drools by kiegroup.
the class DMNKiePMMLTrustyInvocationEvaluator method getPMML4Result.
@Override
protected PMML4Result getPMML4Result(DMNRuntimeEventManager eventManager, DMNResult dmnr) {
PMMLContext pmmlContext = getPMMLPMMLContext(UUID.randomUUID().toString(), model, dmnr);
PMMLRuntime pmmlRuntime = getPMMLRuntime(eventManager);
return pmmlRuntime.evaluate(model, pmmlContext);
}
use of org.kie.pmml.api.runtime.PMMLRuntime in project drools by kiegroup.
the class PMMLRuntimeFactoryInternalTest method getPMMLRuntimeFromFileAndKnowledgeBuilder.
@Test
public void getPMMLRuntimeFromFileAndKnowledgeBuilder() {
File pmmlFile = getFile("MiningModel_Mixed.pmml");
KnowledgeBuilderImpl knowledgeBuilder = new KnowledgeBuilderImpl();
PMMLRuntime retrieved = PMMLRuntimeFactoryInternal.getPMMLRuntime(pmmlFile, knowledgeBuilder);
commonValidatePMMLRuntime(retrieved);
}
use of org.kie.pmml.api.runtime.PMMLRuntime in project drools by kiegroup.
the class PMMLRuntimeFactoryInternalTest method getPMMLRuntimeFromFile.
@Test
public void getPMMLRuntimeFromFile() {
File pmmlFile = getFile("MissingDataRegression.pmml");
PMMLRuntime retrieved = PMMLRuntimeFactoryInternal.getPMMLRuntime(pmmlFile);
commonValidatePMMLRuntime(retrieved);
}
use of org.kie.pmml.api.runtime.PMMLRuntime in project drools by kiegroup.
the class PMMLRuntimeFactoryInternalTest method testGetPMMLRuntimeFromFileAndReleaseId.
@Test
public void testGetPMMLRuntimeFromFileAndReleaseId() {
File pmmlFile = getFile("MiningModel_Mixed.pmml");
ReleaseId releaseId = new ReleaseIdImpl("org.dummy:dummy-artifact:1-0");
PMMLRuntime retrieved = PMMLRuntimeFactoryInternal.getPMMLRuntime(pmmlFile, releaseId);
commonValidatePMMLRuntime(retrieved);
}
Aggregations