The GLMSELECT Procedure

Example 50.7 LASSO with Screening

(View the complete code for this example.)

This example shows how you can use the SCREEN= option to speed up model selection when you have a large number of regressors. In order to demonstrate the efficiency in screening model selection, this example uses simulated data in which the response y depends systematically on a relatively small subset of a much larger set of regressors, which is described in Table 50.13.

Table 50.13: Complete Set of Regressors

Regressor Name

Type

Number of Levels

In True Model

xIn1–xIn5

Continuous

 

Yes

xOut1–xOut1000

Continuous

 

No

cIn1–cIn2

Classification

2–5

Yes

cOut1–cOut1000

Classification

2–5

No


The labels In and Out, which are part of the regressor names, make it easy to identify whether the selected model succeeds or fails in capturing the true underlying model.

The following DATA step generates the data:

%let nObs      = 5000;
%let nContIn   = 5;
%let nContOut  = 1000;
%let nClassIn  = 2;
%let nClassOut = 1000;
%let maxLevs   = 5;
%let noiseScale= 1;

 data ex7Data;
   array xIn{&nContIn};
   array xOut{&nContOut};
   array cIn{&nClassIn};
   array cOut{&nClassOut};

   drop i j sign nLevs xBeta;

   do i=1 to &nObs;
      sign  = -1;
      xBeta = 0;
      do j=1 to dim(xIn);
         xIn{j} = ranuni(1);
         xBeta  = xBeta + sqrt(j)*sign*xIn{j};
         sign   = -sign;
      end;
      do j=1 to dim(xOut);
         xOut{j} = ranuni(1);
      end;

      do j=1 to dim(cIn);
         nLevs  = 2 + mod(j,&maxlevs-1);
         cIn{j} = 1+int(ranuni(1)*nLevs);
         xBeta  = xBeta + j*sign*(cIn{j}-nLevs/2);
         sign   = -sign;
      end;

      do j=1 to dim(cOut);
         nLevs  = 2 + mod(j,&maxlevs-1);
         cOut{j} = 1+int(ranuni(1)*nLevs);
      end;

      y = xBeta + &noiseScale*rannor(1);

      output;
  end;
run;

The following statements apply the LASSO method for model selection but do not specify any screening technique:

proc glmselect data=ex7Data;
   class c:;
   model y = x: c:/
         selection=lasso;
run;

Output 50.7.1 and Output 50.7.2 show the number of observations and the number of effects, respectively. You can see that 5,000 observations are used for training and the number of effects after splits is 4,513.

Output 50.7.1: Number of Training Observations Table

The GLMSELECT Procedure

Number of Observations Read5000
Number of Observations Used5000


Output 50.7.2: Dimensions

Dimensions
Number of Effects2008
Number of Effects after Splits4513
Number of Parameters4513


Output 50.7.3 shows the "LASSO Selection Summary" table. You can see that the selected model contains all the predictive effects and successfully excludes all the noise effects.

Output 50.7.3: LASSO Selection Summary Table

The GLMSELECT Procedure
 
Without the SCREEN= option
 

StepEffect
Entered
Effect
Removed
Number
Effects In
SBC
0Intercept 110413.6418
1cIn2_1 210335.5423
2cIn2_4 37237.0701
3cIn1_1 47186.9642
4cIn1_3 56753.6076
5xIn5 66609.0322
6cIn2_3 76510.2639
7xIn4 85797.1607
8xIn3 95487.4432
9xIn2 102894.0166
10xIn1 11310.9340*
* Optimal Value of Criterion


You can improve the computational performance of the LASSO method by using the SCREEN=SASVI option as follows:

proc glmselect data=ex7Data;
   class c:;
   model y = x: c:/
         selection=lasso(screen=sasvi);
run;

Output 50.7.4 shows that the safe screening approach SASVI is used.

Output 50.7.4: Screening Information

The GLMSELECT Procedure

Screening Information
Screening MethodSASVI (safe screening)


Output 50.7.5 shows the "LASSO Selection Summary" table, which is exactly the same as Output 50.7.3. If you compare the "Parameter Estimates" tables that correspond to Output 50.7.3 and Output 50.7.5, you can see that the parameter estimates are exactly the same, because SASVI is a safe screening approach that guarantees the same solution, usually in less time. PROC GLMSELECT runs about twice as fast when SCREEN=SASVI as it runs when no screening is specified.

Output 50.7.5: LASSO Selection Summary Table

The GLMSELECT Procedure
 
SCREEN=SASVI
 

StepEffect
Entered
Effect
Removed
Number
Effects In
SBC
0Intercept 110413.6418
1cIn2_1 210335.5423
2cIn2_4 37237.0701
3cIn1_1 47186.9642
4cIn1_3 56753.6076
5xIn5 66609.0322
6cIn2_3 76510.2639
7xIn4 85797.1607
8xIn3 95487.4432
9xIn2 102894.0166
10xIn1 11310.9340*
* Optimal Value of Criterion


As an alternative to screening by SASVI, you can specify SCREEN=SIS for sure independence screening as follows:

proc glmselect data=ex7Data;
   class c:;
   model y = x: c:/
         selection=lasso(screen=sis(keepnum=15));
run;

Output 50.7.6 shows that sure independence screening is used and that the number of effects to be kept before applying LASSO for model selection is 15. The last two rows of Output 50.7.6 show the actual number of kept effects and the corresponding ratio with the total number of effects.

Output 50.7.6: Screening Information

The GLMSELECT Procedure

Screening Information
Screening MethodSIS (sure independence screening)
Screening Keep Number15
Actual Kept Number15
Actual Kept Ratio0.003


Output 50.7.7 shows the absolute correlation between the effects and the response that corresponds to the leading 20 effects. Because you specified KEEPNUM=15, only the leading 15 effects are kept for model selection by LASSO. In this example, you can see that all the predictive effects are among the top 15. Note that if the screening stage does not keep an effect, that effect has no chance of being selected in the final model.

Output 50.7.7: LASSO Selection Summary Table

The GLMSELECT Procedure
 
SCREEN=SIS
 

Effect Screening by Correlation
RankEffectMaximum Absolute Correlation
1cIn2_10.621286
2cIn2_40.611998
3cIn1_10.261449
4cIn1_30.259374
5cIn2_30.215103
6xIn50.212433
7xIn40.201704
8cIn2_20.195087
9xIn30.174133
10xIn20.170705
11xIn10.083742
12cOut447_40.061958
13cOut238_10.052981
14cOut538_40.052165
15cOut747_50.051390
16xOut3450.050114*
17cOut511_50.047524*
18cOut630_20.047440*
19cOut672_20.045937*
20cOut672_10.045937*
* Screened Out Effect


Output 50.7.8 shows the "LASSO Selection Summary" table. As in Output 50.7.3, all the predictive effects enter into the model. However, one noise effect also enters into the model, because SCREEN=SIS does not necessarily guarantee the same solution as the solution that results when SCREEN=NONE. For this example, PROC GLMSELECT runs only slightly faster when SCREEN=SIS than it does when SCREEN=SASVI, although it runs about twice as fast as it does when SCREEN=NONE. However, for problems that have more predictors or that use much more computationally intense CHOOSE= criterion, sure independence screening (SIS) can run faster by orders of magnitude.

Output 50.7.8: LASSO Selection Summary Table

The GLMSELECT Procedure
 
SCREEN=SIS
 

StepEffect
Entered
Effect
Removed
Number
Effects In
SBC
0Intercept 110413.6418
1cIn2_1 210335.5423
2cIn2_4 37237.0701
3cIn1_1 47186.9642
4cIn1_3 56753.6076
5xIn5 66609.0322
6cIn2_3 76510.2639
7xIn4 85797.1607
8xIn3 95487.4432
9xIn2 102894.0166
10xIn1 11245.9693
11cOut747_5 12238.4427*
* Optimal Value of Criterion