Best Subset Selection
Let denote the null model, which contains no predictors. This model simply predicts the sample mean for each observation.
For :
(a) Fit all models that contain exactly predictors.
(b) Pick the best among these models, and call it . Here best is defined as having the smallest RSS, or equivalently largest .
Select a single best model from among , using cross-validated prediction error, (AIC), BIC, or adjusted .
Although we have presented best subset selection here for least squares regression, the same ideas apply for other types of models, such as logistic regression. In the case of logistic regression, instead of ordering models by RSS in Step 2, we instead use the deviance, a measure that plays the role of RSS for a broader class of models. The smaller the deviance, the better the fit.
While best subset selection is a simple and conceptually appealing approach, it suffers from computationally limitations, there are models that involve subsets of predictors. They also only work for least square linear regression.
Stepwise Selection
- For computational reasons, best subset selection cannot be applied with very large .
- Best subset selection may also suffer from statistical problems when is large: larger the search space, the higher the chance of finding models that look good on the training data, even though they might not have any predictive power no the future data.
- Thus an enormous search space can lead to overfitting and high variance of the coefficient estimates.
- For both of these reasons, stepwise methods, which explore a far more restricted set of models, are attractive alternatives to best subset selection.
Forward Stepwise Selection
Forward stepwise selection begins with a model containing no predictors, and then adds predictors to the model,one-at-a-time, until all the predictors are in the model. In particular, at each step the variable that gives the greatest additional improvement to the fit is added to the model.
Let denote the null model, which contains no predictors. This model simply predicts the sample mean for each observation.
For :
(a) Consider all models that argument the predictors in with one additional predictor.
(b) Choose the best among these models, and call it . Here best is defined as having the smallest RSS, or equivalently largest .
Select a single best model from among , using cross-validated prediction error, (AIC), BIC, or adjusted .
Computational advantage over best subset selection is clear
- It's not guaranteed to find the best possible model out of all models containing subsets of the predictors.
- Forward stepwise selection can be applied even in the high-dimensional setting where , in this case, it is possible to construct submodels only, since each submodel is fit using least squares, which will not yield a unique solution if .
Backward Stepwise Selection
Like forward stepwise selection, backward stepwise selection provides an efficient alternative to best subset selection. However, unlike forward stepwise selection, it begins with the full least squares model containing all predictors, and then iteratively removes the least useful predictor, one-at-a-time.
Let denote the full model, which contains all predictors.
For :
(a) Consider all models that contain all but one of the predictors in , for a total of predictors.
(b) Choose the best among these models, and clal it . Here best is defined as having the smallest RSS, or equivalently largest .
Select a single best model from among , using cross-validated prediction error, (AIC), BIC, or adjusted .
- Like forward stepwise selection, the backward selection approach searches through only models, and so can be applied in settings where is too large to apply best subset selection.
- Like forward stepwise selection, backward stepwise selection is not guaranteed to yield the best model containing a subset of the predictors.
- Backward selection requires that the number of samples n is larger than the number of variables p. In contrast, forward stepwise can be used even when , and so is the only viable subset method when is very large.
Choosing the Optimal Model
- The model containing all of the predictors will always have the smallest RSS and the largest , since these quantities are related to the training error.
- We wish to choose a model with low test error, not a model with low training error.
- Therefore, RSS and are not suitable for selecting the best model among a collection of models with different numbers of predictors.
We can indirectly estimate test error by making an adjustment to the training error to account for the bias due to overfitting(通过调整training error从而间接估计test error,以解决过度拟合的偏差).
We can directly estimate the test error, using either a validation set approach or a cross-validaion approach.
C_p, AIC, BIC, and Adjusted R^2
- C_p and AIC
Mallow's where is the total number of parameters used and is an estimate of the variance of the error associated with each response measurement.
The AIC criterion is defined for a large class of models fit by maximum likehood:
where is the maximized value of the likehood function for the estimated model. In the case of the linear model with Gaussian errors, maximum likehood and least squares are the same thing, they are equivalent.
- BIC
Notice that BIC replaces the used by with a term, where is the number of observations.
Since for any , the BIC statistic generally places a heavier penalty on models with many variables, and hence results in the selections of small models than .
Adjust R^2 where TSS is the total sum of squares.
Unlike , AIC and BIC, for which a small values indicates a model with a low test error, a large value of adjusted indicates a model with a small test error.
Maximizing the adjusted is equivalent to minimizing , while the number of variables in the model increases.
Unlike the statistic, the adjusted statistic pays a price for the inclusion of unnecessary variables in the model.
Validation and Cross-Validation
We compute the validation set error or the cross-validation error for each model under consideration, and then select the for which the resulting estimated test error is smallest.
The procedure has an advantage relative to AIC, BIC, , and adjusted , in that it provides a direct estimate of the test error, and doesn't require an estimate of the error variance .
It can also be used in a wider range of model selection tasks, even in cases where it is hard to pinpoint the model degrees of freedom(e.g. the number of predictors in the model) or hard to estimate the error variance .