Package org.tribuo.regression.impl
Class SkeletalIndependentRegressionModel
- All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.provenance.Provenancable<ModelProvenance>
,Serializable
A
Model
which wraps n independent regression models, where n is the
size of the MultipleRegressor domain. Each model independently predicts
a single regression dimension.- See Also:
-
Field Summary
Fields inherited from class org.tribuo.Model
ALL_OUTPUTS, BIAS_FEATURE, featureIDMap, generatesProbabilities, name, outputIDInfo, provenance, provenanceOutput
-
Constructor Summary
ModifierConstructorDescriptionprotected
SkeletalIndependentRegressionModel
(String name, String[] dimensions, ModelProvenance modelProvenance, ImmutableFeatureMap featureMap, ImmutableOutputInfo<Regressor> outputInfo) models.size() must equal labelInfo.getDomain().size() -
Method Summary
Modifier and TypeMethodDescriptionprotected SparseVector
createFeatures
(Example<Regressor> example) Creates the feature vector.Uses the model to predict the output for a single example.protected abstract Regressor.DimensionTuple
scoreDimension
(int dimensionIdx, SparseVector features) Makes a prediction for a single dimension.Methods inherited from class org.tribuo.Model
castModel, copy, copy, generatesProbabilities, getExcuse, getExcuses, getFeatureIDMap, getName, getOutputIDInfo, getProvenance, getTopFeatures, innerPredict, predict, predict, setName, toString, validate
-
Field Details
-
dimensions
-
-
Constructor Details
-
SkeletalIndependentRegressionModel
protected SkeletalIndependentRegressionModel(String name, String[] dimensions, ModelProvenance modelProvenance, ImmutableFeatureMap featureMap, ImmutableOutputInfo<Regressor> outputInfo) models.size() must equal labelInfo.getDomain().size()- Parameters:
name
- Model name.dimensions
- Dimension names.modelProvenance
- The model provenance.featureMap
- The feature domain used in training.outputInfo
- The output domain used in training.
-
-
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. -
createFeatures
Creates the feature vector. Does not include a bias term.Designed to be overridden.
- Parameters:
example
- The example to convert.- Returns:
- The feature vector.
-
scoreDimension
Makes a prediction for a single dimension.- Parameters:
dimensionIdx
- The dimension index to predict.features
- The features to use.- Returns:
- A single dimension prediction.
-