LINEAR_ELASTIC_NET

The LINEAR_ELASTIC_NET Extension command is available in the SPSS® Statistics Standard Edition.

LINEAR_ ELASTIC_NET uses the Python sklearn.linear_model.ElasticNet class to estimate regularized linear regression models for a dependent variable on one or more independent variables. Regularization combines L1 (Lasso) and L2 (Ridge) penalties. The extension includes optional modes to display trace plots for different values of alpha for a given L1 ratio, and to select the L1 ratio and alpha hyperparameter values based on crossvalidation. When a single model is fitted or crossvalidation is used to select the penalty ratio and/or alpha, a partition of holdout data can be used to estimate out-of-sample performance.

Note that the terminology used in sklearn and here is different than in some other programs for elastic net models. The alpha parameter in sklearn is sometimes referred to as lambda, and l1_ratio in sklearn then referred to as alpha.

LINEAR_ELASTIC_NET dependent [BY factor list] [WITH covariate list] 
  [/MODE {FIT**     }
         {TRACE     }
         {CROSSVALID}
  [/RATIO VALUES = {.5**                                   }
                   {[value(s)] [value1 TO value2 BY value3]}]
  [/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_ELASTIC_NET extension command can be generated from the Linear Elastic Net Regression dialog box.

Release 29.0
  • Command introduced