public abstract class ModelEvaluator<M extends org.dmg.pmml.Model> extends Object implements Evaluator, HasModel<M>, Serializable
ModelEvaluatorBuilder,
Serialized FormDEFAULT_TARGET_NAME| Modifier | Constructor and Description |
|---|---|
protected |
ModelEvaluator(org.dmg.pmml.PMML pmml,
M model) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
assessParentCompatibility() |
protected boolean |
assessPurity() |
protected Set<org.dmg.pmml.ResultFeature> |
collectResultFeatures() |
void |
configure(Configuration configuration)
Configures the runtime behaviour of this model evaluator.
|
protected <V extends Number> |
createClassification(ValueMap<String,V> values) |
ModelEvaluationContext |
createEvaluationContext() |
protected List<InputField> |
createInputFields() |
protected List<InputField> |
createInputFields(org.dmg.pmml.MiningField.UsageType usageType) |
protected EvaluationException |
createMiningSchemaException(String message) |
protected List<OutputField> |
createOutputFields() |
protected List<TargetField> |
createTargetFields() |
protected Configuration |
ensureConfiguration() |
protected ModelEvaluatorFactory |
ensureModelEvaluatorFactory() |
protected Predicate<org.dmg.pmml.OutputField> |
ensureOutputFilter() |
protected ValueFactory<?> |
ensureValueFactory() |
protected ValueFactoryFactory |
ensureValueFactoryFactory() |
Map<org.dmg.pmml.FieldName,?> |
evaluate(Map<org.dmg.pmml.FieldName,?> arguments)
Evaluates the model with the specified arguments.
|
protected <V extends Number> |
evaluateAssociationRules(ValueFactory<V> valueFactory,
EvaluationContext context) |
protected <V extends Number> |
evaluateClassification(ValueFactory<V> valueFactory,
EvaluationContext context) |
protected <V extends Number> |
evaluateClustering(ValueFactory<V> valueFactory,
EvaluationContext context) |
Map<org.dmg.pmml.FieldName,?> |
evaluateInternal(ModelEvaluationContext context) |
protected <V extends Number> |
evaluateMixed(ValueFactory<V> valueFactory,
EvaluationContext context) |
protected <V extends Number> |
evaluateRegression(ValueFactory<V> valueFactory,
EvaluationContext context) |
protected <V extends Number> |
evaluateSequences(ValueFactory<V> valueFactory,
EvaluationContext context) |
protected <V extends Number> |
evaluateTimeSeries(ValueFactory<V> valueFactory,
EvaluationContext context) |
List<InputField> |
getActiveFields()
Gets the independent (ie. input) fields of a
Model from its MiningSchema. |
Configuration |
getConfiguration() |
protected org.dmg.pmml.DataField |
getDataField() |
org.dmg.pmml.DataField |
getDataField(org.dmg.pmml.FieldName name) |
org.dmg.pmml.DefineFunction |
getDefineFunction(String name) |
org.dmg.pmml.DerivedField |
getDerivedField(org.dmg.pmml.FieldName name) |
List<InputField> |
getInputFields() |
InputMapper |
getInputMapper() |
org.dmg.pmml.DerivedField |
getLocalDerivedField(org.dmg.pmml.FieldName name) |
org.dmg.pmml.MathContext |
getMathContext() |
org.dmg.pmml.MiningField |
getMiningField(org.dmg.pmml.FieldName name) |
org.dmg.pmml.MiningFunction |
getMiningFunction()
Gets the type of the
Model. |
M |
getModel() |
org.dmg.pmml.OutputField |
getOutputField(org.dmg.pmml.FieldName name) |
List<OutputField> |
getOutputFields()
Gets the output fields of a
Model from its Output. |
org.dmg.pmml.PMML |
getPMML() |
Set<org.dmg.pmml.ResultFeature> |
getResultFeatures() |
ResultMapper |
getResultMapper() |
org.dmg.pmml.Target |
getTarget(org.dmg.pmml.FieldName name) |
TargetField |
getTargetField() |
List<TargetField> |
getTargetFields()
Gets the dependent (ie. target in supervised training) fields of a
Model from its MiningSchema. |
org.dmg.pmml.FieldName |
getTargetName() |
<V> V |
getValue(com.google.common.cache.Cache<M,V> cache,
Callable<? extends V> loader) |
<V> V |
getValue(com.google.common.cache.LoadingCache<M,V> cache) |
boolean |
hasResultFeature(org.dmg.pmml.ResultFeature resultFeature)
Indicates if this model evaluator provides the specified result feature.
|
boolean |
isParentCompatible()
Indicates if this model evaluator is compatible with its parent model evaluator.
|
boolean |
isPure()
Indicates if this model evaluator represents a pure function.
|
protected Map<org.dmg.pmml.FieldName,?> |
processArguments(Map<org.dmg.pmml.FieldName,?> arguments) |
protected Map<org.dmg.pmml.FieldName,?> |
processResults(Map<org.dmg.pmml.FieldName,?> results) |
protected org.dmg.pmml.Field<?> |
resolveField(org.dmg.pmml.FieldName name) |
ModelEvaluator<M> |
verify()
Verifies the model.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetSummaryprotected ModelEvaluator(org.dmg.pmml.PMML pmml,
M model)
public void configure(Configuration configuration)
Configures the runtime behaviour of this model evaluator.
Must be called once before the first evaluation. May be called any number of times between subsequent evaluations.
public org.dmg.pmml.MiningFunction getMiningFunction()
Evaluator
Gets the type of the Model.
getMiningFunction in interface Evaluatorpublic org.dmg.pmml.MathContext getMathContext()
public org.dmg.pmml.DataField getDataField(org.dmg.pmml.FieldName name)
protected org.dmg.pmml.DataField getDataField()
DataField element describing the default target field.public org.dmg.pmml.DerivedField getDerivedField(org.dmg.pmml.FieldName name)
public org.dmg.pmml.DefineFunction getDefineFunction(String name)
public org.dmg.pmml.MiningField getMiningField(org.dmg.pmml.FieldName name)
public org.dmg.pmml.DerivedField getLocalDerivedField(org.dmg.pmml.FieldName name)
public org.dmg.pmml.Target getTarget(org.dmg.pmml.FieldName name)
public org.dmg.pmml.OutputField getOutputField(org.dmg.pmml.FieldName name)
public boolean isParentCompatible()
Indicates if this model evaluator is compatible with its parent model evaluator.
A parent compatible model evaluator inherits DataField declarations unchanged,
which makes it possible to propagate DataField and global DerivedField values between evaluation contexts during evaluation.
public boolean isPure()
Indicates if this model evaluator represents a pure function.
A pure model evaluator does not tamper with the evaluation context during evaluation.
public List<InputField> getInputFields()
getInputFields in interface HasInputFieldspublic List<InputField> getActiveFields()
HasActiveFields
Gets the independent (ie. input) fields of a Model from its MiningSchema.
getActiveFields in interface HasActiveFieldspublic List<TargetField> getTargetFields()
HasResultFields
Gets the dependent (ie. target in supervised training) fields of a Model from its MiningSchema.
getTargetFields in interface HasResultFieldspublic TargetField getTargetField()
public org.dmg.pmml.FieldName getTargetName()
public List<OutputField> getOutputFields()
HasResultFields
Gets the output fields of a Model from its Output.
getOutputFields in interface HasResultFieldspublic boolean hasResultFeature(org.dmg.pmml.ResultFeature resultFeature)
Indicates if this model evaluator provides the specified result feature.
A result feature is first and foremost manifested through output fields. However, selected result features may make a secondary manifestation through a target field.
OutputField.getResultFeature()public Set<org.dmg.pmml.ResultFeature> getResultFeatures()
protected EvaluationException createMiningSchemaException(String message)
public ModelEvaluator<M> verify()
EvaluatorVerifies the model.
public ModelEvaluationContext createEvaluationContext()
public Map<org.dmg.pmml.FieldName,?> evaluate(Map<org.dmg.pmml.FieldName,?> arguments)
EvaluatorEvaluates the model with the specified arguments.
evaluate in interface Evaluatorarguments - Map of input field values.target field and output field values.
A target field could be mapped to a complex value or a simple value.
An output field is always mapped to a simple value.
Complex values are represented as instances of Computable that return simple values.
Simple values are represented using the Java equivalents of PMML data types (eg. String, Integer, Float, Double etc.).
A missing value is represented by null.Computableprotected Map<org.dmg.pmml.FieldName,?> processArguments(Map<org.dmg.pmml.FieldName,?> arguments)
protected Map<org.dmg.pmml.FieldName,?> processResults(Map<org.dmg.pmml.FieldName,?> results)
public Map<org.dmg.pmml.FieldName,?> evaluateInternal(ModelEvaluationContext context)
protected <V extends Number> Map<org.dmg.pmml.FieldName,?> evaluateRegression(ValueFactory<V> valueFactory, EvaluationContext context)
protected <V extends Number> Map<org.dmg.pmml.FieldName,?> evaluateClassification(ValueFactory<V> valueFactory, EvaluationContext context)
protected <V extends Number> Map<org.dmg.pmml.FieldName,?> evaluateClustering(ValueFactory<V> valueFactory, EvaluationContext context)
protected <V extends Number> Map<org.dmg.pmml.FieldName,?> evaluateAssociationRules(ValueFactory<V> valueFactory, EvaluationContext context)
protected <V extends Number> Map<org.dmg.pmml.FieldName,?> evaluateSequences(ValueFactory<V> valueFactory, EvaluationContext context)
protected <V extends Number> Map<org.dmg.pmml.FieldName,?> evaluateTimeSeries(ValueFactory<V> valueFactory, EvaluationContext context)
protected <V extends Number> Map<org.dmg.pmml.FieldName,?> evaluateMixed(ValueFactory<V> valueFactory, EvaluationContext context)
protected <V extends Number> Classification<V> createClassification(ValueMap<String,V> values)
protected boolean assessParentCompatibility()
protected boolean assessPurity()
protected List<InputField> createInputFields()
protected List<InputField> createInputFields(org.dmg.pmml.MiningField.UsageType usageType)
protected List<TargetField> createTargetFields()
protected List<OutputField> createOutputFields()
protected Set<org.dmg.pmml.ResultFeature> collectResultFeatures()
protected org.dmg.pmml.Field<?> resolveField(org.dmg.pmml.FieldName name)
public <V> V getValue(com.google.common.cache.LoadingCache<M,V> cache)
public <V> V getValue(com.google.common.cache.Cache<M,V> cache, Callable<? extends V> loader)
protected Configuration ensureConfiguration()
protected ModelEvaluatorFactory ensureModelEvaluatorFactory()
protected ValueFactoryFactory ensureValueFactoryFactory()
protected Predicate<org.dmg.pmml.OutputField> ensureOutputFilter()
protected ValueFactory<?> ensureValueFactory()
public M getModel()
public Configuration getConfiguration()
public InputMapper getInputMapper()
public ResultMapper getResultMapper()
Copyright © 2019. All rights reserved.