Optimizing the ridge regression parameter
Once you start using ridge regression to make predictions or learn about relationships in the system you're modeling, you'll start thinking about the choice of alpha.
For example, using OLS regression might show some relationship between two variables; however, when regularized by some alpha, the relationship is no longer significant. This can be a matter of whether a decision needs to be taken.
Getting ready
This is the first recipe where we'll tune the parameters for a model. This is typically done by cross-validation. There will be recipes laying out a more general way to do this in later recipes, but here we'll walkthrough to be able to tune ridge regression.
If you remember, in ridge regression, the gamma ...
Get scikit-learn : Machine Learning Simplified now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.