Class WeightedEnsembleModel<T extends Output<T>>
java.lang.Object
org.tribuo.Model<T>
org.tribuo.ensemble.EnsembleModel<T>
org.tribuo.ensemble.WeightedEnsembleModel<T>
- All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.provenance.Provenancable<ModelProvenance>
,Serializable
An ensemble model that uses weights to combine the ensemble member predictions.
- See Also:
-
Field Summary
FieldsFields inherited from class org.tribuo.ensemble.EnsembleModel
models
Fields inherited from class org.tribuo.Model
ALL_OUTPUTS, BIAS_FEATURE, featureIDMap, generatesProbabilities, name, outputIDInfo, provenance, provenanceOutput
-
Constructor Summary
ConstructorsConstructorDescriptionWeightedEnsembleModel
(String name, EnsembleModelProvenance description, ImmutableFeatureMap featureIDMap, ImmutableOutputInfo<T> outputIDInfo, List<Model<T>> newModels, EnsembleCombiner<T> combiner) WeightedEnsembleModel
(String name, EnsembleModelProvenance description, ImmutableFeatureMap featureIDMap, ImmutableOutputInfo<T> outputIDInfo, List<Model<T>> newModels, EnsembleCombiner<T> combiner, float[] weights) -
Method Summary
Modifier and TypeMethodDescriptionprotected EnsembleModel
<T> Generates an excuse for an example.Uses the model to predict the output for a single example.Methods inherited from class org.tribuo.ensemble.EnsembleModel
copy, getModels, getNumModels, getProvenance, getTopFeatures
Methods inherited from class org.tribuo.Model
copy, generatesProbabilities, getExcuses, getFeatureIDMap, getName, getOutputIDInfo, innerPredict, predict, predict, setName, toString, validate
-
Field Details
-
weights
-
combiner
-
-
Constructor Details
-
WeightedEnsembleModel
public WeightedEnsembleModel(String name, EnsembleModelProvenance description, ImmutableFeatureMap featureIDMap, ImmutableOutputInfo<T> outputIDInfo, List<Model<T>> newModels, EnsembleCombiner<T> combiner) -
WeightedEnsembleModel
public WeightedEnsembleModel(String name, EnsembleModelProvenance description, ImmutableFeatureMap featureIDMap, ImmutableOutputInfo<T> outputIDInfo, List<Model<T>> newModels, EnsembleCombiner<T> combiner, float[] weights)
-
-
Method Details
-
predict
Description copied from class:Model
Uses the model to predict the output for a single example.predict does not mutate the example.
Throws
IllegalArgumentException
if the example has no features or no feature overlap with the model. -
getExcuse
Description copied from class:Model
Generates an excuse for an example.This attempts to explain a classification result. Generating an excuse may be quite an expensive operation.
This excuse either contains per class information or an entry with key Model.ALL_OUTPUTS.
The optional is empty if the model does not provide excuses.
- Specified by:
getExcuse
in classEnsembleModel<T extends Output<T>>
- Parameters:
example
- The input example.- Returns:
- An optional excuse object. The optional is empty if this model does not provide excuses.
-
copy
protected EnsembleModel<T> copy(String name, EnsembleModelProvenance newProvenance, List<Model<T>> newModels) - Specified by:
copy
in classEnsembleModel<T extends Output<T>>
-