public class JPmmlModelRunner extends Object implements PmmlModelRunner<Tuple,Map<org.dmg.pmml.FieldName,Object>,Map<org.dmg.pmml.FieldName,org.jpmml.evaluator.FieldValue>,Map<org.dmg.pmml.FieldName,?>>
JPMML implementation of PmmlModelRunner
. It extracts the raw inputs from the tuple for all ‘active fields’, and builds a tuple with the predicted scores for the ‘predicted fields’ and ‘output fields’. In this implementation all the declared streams will have the same scored tuple.
The ‘predicted’, ‘active’, and ‘output’ fields are extracted from the PMML model.
Constructor and Description |
---|
JPmmlModelRunner(org.jpmml.evaluator.Evaluator evaluator,
ModelOutputs modelOutputs) |
Modifier and Type | Method and Description |
---|---|
Map<org.dmg.pmml.FieldName,Object> |
extractRawInputs(Tuple tuple)
Extract raw inputs.
|
List<org.dmg.pmml.FieldName> |
getActiveFields() |
org.jpmml.evaluator.Evaluator |
getEval() |
ModelOutputs |
getModelOutputs() |
List<org.dmg.pmml.FieldName> |
getOutputFields() |
List<org.dmg.pmml.FieldName> |
getPredictedFields() |
Map<org.dmg.pmml.FieldName,?> |
predictScores(Map<org.dmg.pmml.FieldName,org.jpmml.evaluator.FieldValue> preProcInputs)
Compute the predicted scores from the pre-processed inputs in the step above.
|
Map<org.dmg.pmml.FieldName,org.jpmml.evaluator.FieldValue> |
preProcessInputs(Map<org.dmg.pmml.FieldName,Object> rawInputs)
Pre process inputs, i.e., remove missing fields, outliers, etc
|
Map<String,List<Object>> |
scoredTuplePerStream(Tuple input)
Retrieve scores.
|
public JPmmlModelRunner(org.jpmml.evaluator.Evaluator evaluator, ModelOutputs modelOutputs)
public Map<org.dmg.pmml.FieldName,Object> extractRawInputs(Tuple tuple)
Extract raw inputs.
extractRawInputs
in interface PmmlModelRunner<Tuple,Map<org.dmg.pmml.FieldName,Object>,Map<org.dmg.pmml.FieldName,org.jpmml.evaluator.FieldValue>,Map<org.dmg.pmml.FieldName,?>>
tuple
- source from which to extract raw inputspublic Map<org.dmg.pmml.FieldName,org.jpmml.evaluator.FieldValue> preProcessInputs(Map<org.dmg.pmml.FieldName,Object> rawInputs)
PmmlModelRunner
Pre process inputs, i.e., remove missing fields, outliers, etc
preProcessInputs
in interface PmmlModelRunner<Tuple,Map<org.dmg.pmml.FieldName,Object>,Map<org.dmg.pmml.FieldName,org.jpmml.evaluator.FieldValue>,Map<org.dmg.pmml.FieldName,?>>
rawInputs
- that are to be preprocessedpublic Map<org.dmg.pmml.FieldName,?> predictScores(Map<org.dmg.pmml.FieldName,org.jpmml.evaluator.FieldValue> preProcInputs)
PmmlModelRunner
Compute the predicted scores from the pre-processed inputs in the step above.
predictScores
in interface PmmlModelRunner<Tuple,Map<org.dmg.pmml.FieldName,Object>,Map<org.dmg.pmml.FieldName,org.jpmml.evaluator.FieldValue>,Map<org.dmg.pmml.FieldName,?>>
preProcInputs
- that are to be preprocessedpublic Map<String,List<Object>> scoredTuplePerStream(Tuple input)
Retrieve scores.
scoredTuplePerStream
in interface ModelRunner
public org.jpmml.evaluator.Evaluator getEval()
public List<org.dmg.pmml.FieldName> getActiveFields()
public List<org.dmg.pmml.FieldName> getPredictedFields()
public List<org.dmg.pmml.FieldName> getOutputFields()
public ModelOutputs getModelOutputs()
Copyright © 2019 The Apache Software Foundation. All rights reserved.