public abstract class SkeletalIndependentRegressionSparseModel extends SparseModel<Regressor>
SparseModel
which wraps n independent regression models, where n is the
size of the MultipleRegressor domain. Each model independently predicts
a single regression dimension.Modifier and Type | Field and Description |
---|---|
protected String[] |
dimensions |
ALL_OUTPUTS, BIAS_FEATURE, featureIDMap, generatesProbabilities, name, outputIDInfo, provenance, provenanceOutput
Modifier | Constructor and Description |
---|---|
protected |
SkeletalIndependentRegressionSparseModel(String name,
String[] dimensions,
ModelProvenance modelProvenance,
ImmutableFeatureMap featureMap,
ImmutableOutputInfo<Regressor> outputInfo,
Map<String,List<String>> activeFeatures)
models.size() must equal labelInfo.getDomain().size()
|
Modifier and Type | Method and Description |
---|---|
protected SparseVector |
createFeatures(Example<Regressor> example)
Creates the feature vector.
|
Prediction<Regressor> |
predict(Example<Regressor> example)
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.
|
copy, getActiveFeatures
copy, generatesProbabilities, getExcuse, getExcuses, getFeatureIDMap, getName, getOutputIDInfo, getProvenance, getTopFeatures, innerPredict, predict, predict, setName, toString, validate
protected final String[] dimensions
protected SkeletalIndependentRegressionSparseModel(String name, String[] dimensions, ModelProvenance modelProvenance, ImmutableFeatureMap featureMap, ImmutableOutputInfo<Regressor> outputInfo, Map<String,List<String>> activeFeatures)
name
- Model name.dimensions
- Dimension names.modelProvenance
- The model provenance.featureMap
- The feature domain used in training.outputInfo
- The output domain used in training.activeFeatures
- The active features in this model.public Prediction<Regressor> predict(Example<Regressor> example)
Model
predict does not mutate the example.
Throws IllegalArgumentException
if the example has no features
or no feature overlap with the model.
protected SparseVector createFeatures(Example<Regressor> example)
Designed to be overridden, called by the predict method.
example
- The example to convert.protected abstract Regressor.DimensionTuple scoreDimension(int dimensionIdx, SparseVector features)
dimensionIdx
- The dimension index to predict.features
- The features to use.Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.