Class LARSLassoTrainer

java.lang.Object
org.tribuo.regression.slm.SLMTrainer
org.tribuo.regression.slm.LARSLassoTrainer
All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable, com.oracle.labs.mlrg.olcut.provenance.Provenancable<TrainerProvenance>, SparseTrainer<Regressor>, Trainer<Regressor>, WeightedExamples

public class LARSLassoTrainer extends SLMTrainer
A trainer for a lasso linear regression model which uses LARS to construct the model. Each output dimension is trained independently.

See:

 Efron B, Hastie T, Johnstone I, Tibshirani R.
 "Least Angle Regression"
 The Annals of Statistics, 2004.
 
  • Constructor Details

    • LARSLassoTrainer

      public LARSLassoTrainer(int maxNumFeatures)
      Constructs a lasso LARS trainer for a linear model.
      Parameters:
      maxNumFeatures - The maximum number of features to select. Supply -1 to select all features.
    • LARSLassoTrainer

      public LARSLassoTrainer()
      Constructs a lasso LARS trainer that selects all the features.
  • Method Details

    • newWeights

      protected DenseVector newWeights(org.tribuo.regression.slm.SLMTrainer.SLMState state)
      Description copied from class: SLMTrainer
      Computes the new feature weights.

      In this version it returns the ordinary least squares solution for the current state.

      Overrides:
      newWeights in class SLMTrainer
      Parameters:
      state - The SLM state to operate on.
      Returns:
      The new feature weights.
    • toString

      public String toString()
      Overrides:
      toString in class SLMTrainer