type
Post
Created date
Jun 16, 2022 01:21 PM
category
Data Science
tags
Machine Learning
Machine Learning
status
Published
Language
From
summary
slug
password
Author
Priority
Featured
Featured
Cover
Origin
Type
URL
Youtube
Youtube
icon
Definition
There are 3 methods to exclude irrelevant variables - reduce the dimension:
- What are learning: Subset selection
- Shrinkage: Regularization - Ridge & Lasso
- Dimension reduction: e.g., PCA or LDA
Theory
There are 4 ways of selecting a subset: 1) the most original and (stupidpest) - is Best Subset Selection; 2) Forwards Stepwise; 3) Backwards Stepwise
; 4) Stepwise selection
Best Subset Selection
Fit all possible regression models using one or more of the predictors.
The overall best model is chosen from the remaining models.
The best model is chosen through cross-validation or some other method that chooses the model with the lowest measure of test error. ETC3550, we use CV, AIC, AICc
In this final step, a model cannot be chosen based on R-squared, because R-squared always increases when more predictors are added. The model with the lowest K-Fold CV test errors is the best model.
It is computationally expensive and as the # of predictors increases, the combination grows exponentially.
- For example, 44 predictors leads to 18 trillion possible models!
Forward selection
Starts with no predictors in the model (null model), iteratively adds the most contributive predictors and stops when the improvement is no longer statistically significant.
improvement is determined by metrics like RSS, CV or adjusted R square.
This is repeated until a best subset of ‘k’ predictors (features) are selected.
![notion image](https://www.notion.so/image/https%3A%2F%2Ffile.notion.so%2Ff%2Ff%2Fe1c5ba0e-562a-49b0-8505-ce5e38fc061b%2Fcbd63df0-2f58-49e3-81b5-1c5c9df7aa5e%2FUntitled.png%3Ftable%3Dblock%26id%3De951d1cd-f892-45d8-89d7-b74b21970274%26spaceId%3De1c5ba0e-562a-49b0-8505-ce5e38fc061b%26expirationTimestamp%3D1725789600000%26signature%3Dd_FIMrn91EfpKNBb7eowG6fQeXzwpo0Hv59Pq1mNEDM?table=block&id=e951d1cd-f892-45d8-89d7-b74b21970274&cache=v2)
Backward selection (or backward elimination),
Start with a model containing all variables.
Try subtracting one variable at a time.
Keep the model if it has lower CV or AICc. Iterate until no further improvement.
In another words, Starts with all predictors in the model (full model), iteratively removes the least contributive predictors and stops when you have a model where all predictors are statistically significant.
improvement is determined by metrics like RSS,CV or adjusted R square; ETC3550 uses CV or AICc
![notion image](https://www.notion.so/image/https%3A%2F%2Ffile.notion.so%2Ff%2Ff%2Fe1c5ba0e-562a-49b0-8505-ce5e38fc061b%2Fe0d76f5e-fb5c-414c-a876-402f67f31ab8%2F1_FrZouYQpASK0YJ1x81dNWw.png%3Ftable%3Dblock%26id%3D464483d1-edfd-4e5a-bb00-33eb029d6ec1%26spaceId%3De1c5ba0e-562a-49b0-8505-ce5e38fc061b%26expirationTimestamp%3D1725789600000%26signature%3DIm5mHKwZmqCyciJLhI76FmqXL0ROiNcQ9-gf89xdeVg?table=block&id=464483d1-edfd-4e5a-bb00-33eb029d6ec1&cache=v2)
Notes:
- Computational power is very similar to forwarding Selection.
- Stepwise regression is not guaranteed to lead to the best possible model.
- Inference on coefficients of final model will be wrong.
Stepwise selection (or sequential replacement)
is a combination of forward and backward selections. You start with no predictors, then sequentially add the most contributive predictors (like forward selection). After adding each new variable, remove any variables that no longer provide an improvement in the model fit (like backward selection).
Assumption
Shortcoming
Example
R code
[STHDA] explains the code.
R interpretation
Math
Reference
Extra Resource
Forward Feature Selection - YouTube - vidhya
- Author:Jason Siu
- URL:https://jason-siu.com/article/e953542a-2b6e-4db5-a8fb-2ee868c714b1
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!
Relate Posts