public final class WeightedEnsembleModel<T extends Output<T>> extends EnsembleModel<T>
Modifier and Type | Field and Description |
---|---|
protected EnsembleCombiner<T> |
combiner |
protected float[] |
weights |
models
ALL_OUTPUTS, BIAS_FEATURE, featureIDMap, generatesProbabilities, name, outputIDInfo, provenance, provenanceOutput
Constructor and Description |
---|
WeightedEnsembleModel(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) |
Modifier and Type | Method and Description |
---|---|
protected EnsembleModel<T> |
copy(String name,
EnsembleModelProvenance newProvenance,
List<Model<T>> newModels) |
Optional<Excuse<T>> |
getExcuse(Example<T> example)
Generates an excuse for an example.
|
Prediction<T> |
predict(Example<T> example)
Uses the model to predict the output for a single example.
|
copy, getModels, getNumModels, getProvenance, getTopFeatures
copy, generatesProbabilities, getExcuses, getFeatureIDMap, getName, getOutputIDInfo, innerPredict, predict, predict, setName, toString, validate
protected final float[] weights
protected final EnsembleCombiner<T extends Output<T>> combiner
public WeightedEnsembleModel(String name, EnsembleModelProvenance description, ImmutableFeatureMap featureIDMap, ImmutableOutputInfo<T> outputIDInfo, List<Model<T>> newModels, EnsembleCombiner<T> combiner)
public WeightedEnsembleModel(String name, EnsembleModelProvenance description, ImmutableFeatureMap featureIDMap, ImmutableOutputInfo<T> outputIDInfo, List<Model<T>> newModels, EnsembleCombiner<T> combiner, float[] weights)
public Prediction<T> predict(Example<T> example)
Model
predict does not mutate the example.
Throws IllegalArgumentException
if the example has no features
or no feature overlap with the model.
public Optional<Excuse<T>> getExcuse(Example<T> example)
Model
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.
getExcuse
in class EnsembleModel<T extends Output<T>>
example
- The input example.protected EnsembleModel<T> copy(String name, EnsembleModelProvenance newProvenance, List<Model<T>> newModels)
copy
in class EnsembleModel<T extends Output<T>>
Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.