LINEAR_LASSO

The LINEAR_LASSO Extension command is available in the SPSS® Statistics Base Edition.

LINEAR_LASSO uses the Python sklearn.linear_model.Lasso class to estimate L1 loss regularized linear regression models for a dependent variable on one or more independent variables, and includes optional modes to display trace plots and to select the alpha hyperparameter value based on crossvalidation. When a single model is fitted or crossvalidation is used to select alpha, a partition of holdout data can be used to estimate out-of-sample performance.

LINEAR_LASSO dependent [BY factor list] [WITH covariate list] 
  [/MODE {FIT**     }
         {TRACE     }
         {CROSSVALID}
  [/ALPHA VALUES = {1**                                    }
                   {[value(s)] [value1 TO value2 BY value3]}]
          METRIC = {LINEAR**}
                   {LG10    }
  [/CRITERIA INTERCEPT = {TRUE**} STANDARDIZE = {TRUE**} TIMER = {5**  } 
                         {FALSE }               {FALSE}          {value}       
                NFOLDS = {5    } STATE = {0    }
                         {value}         {value}
            TRACETABLE = {0**    }
                         {integer}
  [/PARTITION {TRAINING = {70**   } HOLDOUT = {30**   }}]
                          {integer}           {integer}
              {VARIABLE = varname}
  [/PRINT {BEST** }
          {COMPARE} 
          {VERBOSE}]
  [/PLOT {MSE} {R2} {OBSERVED} {RESIDUAL}]
  [/SAVE {PRED(varname)} {RESID(varname)}]

** Default if the subcommand or keyword is omitted.

This command reads the active dataset and causes execution of any pending commands. See the "Command Order" topic for more information.

Syntax for the LINEAR_LASSO extension command can be generated from the Linear Lasso Regression dialog box.

Release 29.0
  • Command introduced