Search in sources :

Example 1 with PMMLRequestDataBuilder

use of org.kie.pmml.evaluator.core.utils.PMMLRequestDataBuilder in project drools by kiegroup.

the class PMMLTreeModelEvaluatorTest method getPMMLRequestData.

private PMMLRequestData getPMMLRequestData(String modelName, Map<String, Object> parameters) {
    String correlationId = "CORRELATION_ID";
    PMMLRequestDataBuilder pmmlRequestDataBuilder = new PMMLRequestDataBuilder(correlationId, modelName);
    for (Map.Entry<String, Object> entry : parameters.entrySet()) {
        Object pValue = entry.getValue();
        Class class1 = pValue.getClass();
        pmmlRequestDataBuilder.addParameter(entry.getKey(), pValue, class1);
    }
    return pmmlRequestDataBuilder.build();
}
Also used : PMMLRequestDataBuilder(org.kie.pmml.evaluator.core.utils.PMMLRequestDataBuilder) BeforeClass(org.junit.BeforeClass) HashMap(java.util.HashMap) Map(java.util.Map)

Example 2 with PMMLRequestDataBuilder

use of org.kie.pmml.evaluator.core.utils.PMMLRequestDataBuilder in project drools by kiegroup.

the class PMMLScorecardModelEvaluatorTest method getPMMLRequestData.

private PMMLRequestData getPMMLRequestData(String modelName, Map<String, Object> parameters) {
    String correlationId = "CORRELATION_ID";
    PMMLRequestDataBuilder pmmlRequestDataBuilder = new PMMLRequestDataBuilder(correlationId, modelName);
    for (Map.Entry<String, Object> entry : parameters.entrySet()) {
        Object pValue = entry.getValue();
        Class class1 = pValue.getClass();
        pmmlRequestDataBuilder.addParameter(entry.getKey(), pValue, class1);
    }
    return pmmlRequestDataBuilder.build();
}
Also used : PMMLRequestDataBuilder(org.kie.pmml.evaluator.core.utils.PMMLRequestDataBuilder) BeforeClass(org.junit.BeforeClass) HashMap(java.util.HashMap) Map(java.util.Map)

Example 3 with PMMLRequestDataBuilder

use of org.kie.pmml.evaluator.core.utils.PMMLRequestDataBuilder in project drools by kiegroup.

the class AbstractPMMLTest method getPMMLRequestData.

protected static PMMLRequestData getPMMLRequestData(String modelName, Map<String, Object> parameters) {
    String correlationId = "CORRELATION_ID";
    PMMLRequestDataBuilder pmmlRequestDataBuilder = new PMMLRequestDataBuilder(correlationId, modelName);
    for (Map.Entry<String, Object> entry : parameters.entrySet()) {
        Object pValue = entry.getValue();
        Class class1 = pValue.getClass();
        pmmlRequestDataBuilder.addParameter(entry.getKey(), pValue, class1);
    }
    return pmmlRequestDataBuilder.build();
}
Also used : PMMLRequestDataBuilder(org.kie.pmml.evaluator.core.utils.PMMLRequestDataBuilder) Map(java.util.Map)

Example 4 with PMMLRequestDataBuilder

use of org.kie.pmml.evaluator.core.utils.PMMLRequestDataBuilder in project drools by kiegroup.

the class DMNKiePMMLTrustyInvocationEvaluator method getPMMLPMMLContext.

private PMMLContext getPMMLPMMLContext(String correlationId, String modelName, DMNResult dmnr) {
    PMMLRequestDataBuilder pmmlRequestDataBuilder = new PMMLRequestDataBuilder(correlationId, modelName);
    for (FormalParameter p : parameters) {
        Object pValue = getValueForPMMLInput(dmnr, p.name);
        Class class1 = pValue.getClass();
        pmmlRequestDataBuilder.addParameter(p.name, pValue, class1);
    }
    return new PMMLContextImpl(pmmlRequestDataBuilder.build());
}
Also used : FormalParameter(org.kie.dmn.core.ast.DMNFunctionDefinitionEvaluator.FormalParameter) PMMLContextImpl(org.kie.pmml.evaluator.core.PMMLContextImpl) PMMLRequestDataBuilder(org.kie.pmml.evaluator.core.utils.PMMLRequestDataBuilder)

Aggregations

PMMLRequestDataBuilder (org.kie.pmml.evaluator.core.utils.PMMLRequestDataBuilder)4 Map (java.util.Map)3 HashMap (java.util.HashMap)2 BeforeClass (org.junit.BeforeClass)2 FormalParameter (org.kie.dmn.core.ast.DMNFunctionDefinitionEvaluator.FormalParameter)1 PMMLContextImpl (org.kie.pmml.evaluator.core.PMMLContextImpl)1