Package org.tribuo
Class SparseModel<T extends Output<T>>
java.lang.Object
org.tribuo.Model<T>
org.tribuo.SparseModel<T>
- All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.provenance.Provenancable<ModelProvenance>
,Serializable
,ProtoSerializable<org.tribuo.protos.core.ModelProto>
- Direct Known Subclasses:
SkeletalIndependentRegressionSparseModel
,TreeModel
A model which uses a subset of the features it knows about to make predictions.
- See Also:
-
Field Summary
Fields inherited from class org.tribuo.Model
ALL_OUTPUTS, BIAS_FEATURE, featureIDMap, generatesProbabilities, name, outputIDInfo, provenance, provenanceOutput
Fields inherited from interface org.tribuo.protos.ProtoSerializable
DESERIALIZATION_METHOD_NAME, PROVENANCE_SERIALIZER
-
Constructor Summary
ConstructorDescriptionSparseModel
(String name, ModelProvenance provenance, ImmutableFeatureMap featureIDMap, ImmutableOutputInfo<T> outputIDInfo, boolean generatesProbabilities, Map<String, List<String>> activeFeatures) Constructs a sparse model from the supplied arguments. -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Copies a model, returning a deep copy of any mutable state, and a shallow copy otherwise.Return an immutable view on the active features for each dimension.Methods inherited from class org.tribuo.Model
castModel, copy, createDataCarrier, deserialize, deserializeFromFile, deserializeFromStream, generatesProbabilities, getExcuse, getExcuses, getFeatureIDMap, getName, getOutputIDInfo, getProvenance, getTopFeatures, innerPredict, predict, predict, predict, serialize, serializeToFile, serializeToStream, setName, toString, validate
-
Constructor Details
-
SparseModel
public SparseModel(String name, ModelProvenance provenance, ImmutableFeatureMap featureIDMap, ImmutableOutputInfo<T> outputIDInfo, boolean generatesProbabilities, Map<String, List<String>> activeFeatures) Constructs a sparse model from the supplied arguments.- Parameters:
name
- The model name.provenance
- The model provenance.featureIDMap
- The features the model knows.outputIDInfo
- The outputs the model can produce.generatesProbabilities
- Does this model generate probabilistic outputs.activeFeatures
- The active features in this model.
-
-
Method Details
-
getActiveFeatures
Return an immutable view on the active features for each dimension.Sorted lexicographically.
- Returns:
- The active features.
-
copy
Description copied from class:Model
Copies a model, returning a deep copy of any mutable state, and a shallow copy otherwise.
-