public abstract class ModelEvaluator<M extends org.dmg.pmml.Model> extends Object implements Evaluator, HasModel<M>, HasPMML, Serializable
DEFAULT_TARGET_NAME| Modifier | Constructor and Description |
|---|---|
protected |
ModelEvaluator(org.dmg.pmml.PMML pmml,
M model) |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(ModelEvaluatorFactory modelEvaluatorFactory)
Configures the runtime behaviour of this
Evaluator instance. |
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 ModelEvaluatorFactory |
ensureModelEvaluatorFactory() |
protected M |
ensureScorableModel() |
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.
|
abstract Map<org.dmg.pmml.FieldName,?> |
evaluate(ModelEvaluationContext context) |
List<InputField> |
getActiveFields()
Gets the independent (ie. input) fields of a
Model from its MiningSchema. |
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() |
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() |
ModelEvaluatorFactory |
getModelEvaluatorFactory() |
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() |
org.dmg.pmml.Target |
getTarget(org.dmg.pmml.FieldName name) |
TargetField |
getTargetField() |
org.dmg.pmml.FieldName |
getTargetFieldName() |
List<TargetField> |
getTargetFields()
Gets the dependent (ie. target in supervised training) fields of a
Model from its MiningSchema. |
<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) |
ValueFactory<?> |
getValueFactory() |
ValueFactoryFactory |
getValueFactoryFactory() |
boolean |
isPrimitive() |
protected org.dmg.pmml.DerivedField |
resolveDerivedField(org.dmg.pmml.FieldName name) |
protected org.dmg.pmml.Field<?> |
resolveField(org.dmg.pmml.FieldName name) |
void |
verify()
Verifies the model.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetSummaryprotected ModelEvaluator(org.dmg.pmml.PMML pmml,
M model)
public abstract Map<org.dmg.pmml.FieldName,?> evaluate(ModelEvaluationContext context)
public void configure(ModelEvaluatorFactory modelEvaluatorFactory)
Configures the runtime behaviour of this Evaluator instance.
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 isPrimitive()
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 getTargetFieldName()
public List<OutputField> getOutputFields()
HasResultFields
Gets the output fields of a Model from its Output.
getOutputFields in interface HasResultFieldsprotected EvaluationException createMiningSchemaException(String message)
public void verify()
EvaluatorVerifies the model.
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 org.dmg.pmml.Field<?> resolveField(org.dmg.pmml.FieldName name)
protected org.dmg.pmml.DerivedField resolveDerivedField(org.dmg.pmml.FieldName name)
protected List<InputField> createInputFields()
protected List<InputField> createInputFields(org.dmg.pmml.MiningField.UsageType usageType)
protected List<TargetField> createTargetFields()
protected List<OutputField> createOutputFields()
protected M ensureScorableModel()
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 ModelEvaluatorFactory ensureModelEvaluatorFactory()
protected ValueFactoryFactory ensureValueFactoryFactory()
protected ValueFactory<?> ensureValueFactory()
public M getModel()
public ModelEvaluatorFactory getModelEvaluatorFactory()
public ValueFactoryFactory getValueFactoryFactory()
public ValueFactory<?> getValueFactory()
Copyright © 2018. All rights reserved.