Class LARSTrainer
java.lang.Object
org.tribuo.regression.slm.SLMTrainer
org.tribuo.regression.slm.LARSTrainer
- All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable,com.oracle.labs.mlrg.olcut.provenance.Provenancable<TrainerProvenance>,SparseTrainer<Regressor>,Trainer<Regressor>,WeightedExamples
A trainer for a linear regression model which uses least angle regression.
Each output dimension is trained independently.
See:
Efron B, Hastie T, Johnstone I, Tibshirani R. "Least Angle Regression" The Annals of Statistics, 2004.
-
Field Summary
Fields inherited from class org.tribuo.regression.slm.SLMTrainer
maxNumFeatures, normalize, trainInvocationCounterFields inherited from interface org.tribuo.Trainer
DEFAULT_SEED, INCREMENT_INVOCATION_COUNT -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a least angle regression trainer that selects all the features.LARSTrainer(int maxNumFeatures) Constructs a least angle regression trainer for a linear model. -
Method Summary
Modifier and TypeMethodDescriptionprotected DenseVectornewWeights(org.tribuo.regression.slm.SLMTrainer.SLMState state) Computes the new feature weights.toString()Methods inherited from class org.tribuo.regression.slm.SLMTrainer
getInvocationCount, getProvenance, setInvocationCount, train, trainMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.oracle.labs.mlrg.olcut.config.Configurable
postConfigMethods inherited from interface org.tribuo.SparseTrainer
train
-
Constructor Details
-
LARSTrainer
public LARSTrainer(int maxNumFeatures) Constructs a least angle regression trainer for a linear model.- Parameters:
maxNumFeatures- The maximum number of features to select. Supply -1 to select all features.
-
LARSTrainer
public LARSTrainer()Constructs a least angle regression trainer that selects all the features.
-
-
Method Details
-
newWeights
Description copied from class:SLMTrainerComputes the new feature weights.In this version it returns the ordinary least squares solution for the current state.
- Overrides:
newWeightsin classSLMTrainer- Parameters:
state- The SLM state to operate on.- Returns:
- The new feature weights.
-
toString
- Overrides:
toStringin classSLMTrainer
-