[scikit-learn] Use of Scaler with LassoCV, RidgeCV

Dale T Smith Dale.T.Smith at macys.com
Tue Sep 13 08:26:40 EDT 2016


Hmm. I would scale the training data, and then use the same scaling on the test and validation data. This isn’t quite what you asked, but it’s close and does involve transformations and pipelines. Perhaps you can modify according to your use case, introducing the scaling before PolynomialFeatures is called.

https://www.datarobot.com/blog/regularized-linear-regression-with-scikit-learn/

__________________________________________________________________________________________
Dale Smith | Macy's Systems and Technology | IFS eCommerce | Data Science
770-658-5176 | 5985 State Bridge Road, Johns Creek, GA 30097 | dale.t.smith at macys.com

From: scikit-learn [mailto:scikit-learn-bounces+dale.t.smith=macys.com at python.org] On Behalf Of Brenet, Yoann
Sent: Tuesday, September 13, 2016 8:16 AM
To: scikit-learn at python.org
Subject: [scikit-learn] Use of Scaler with LassoCV, RidgeCV

⚠ EXT MSG:
Hi all,

I was trying to use scikit-learn LassoCV/RidgeCV while applying a 'StandardScaler' on each fold set. I do not want to apply the scaler before the cross-validation to avoid leakage but I cannot figure out how I am supposed to do that with LassoCV/RidgeCV.

Is there a way to do this ? Or should I create a pipeline with Lasso/Ridge and 'manually' search for the hyper-parameters (using GridSearchCV for instance) ?

Many thanks.

Yoann
* This is an EXTERNAL EMAIL. Stop and think before clicking a link or opening attachments.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20160913/8a97635f/attachment-0001.html>


More information about the scikit-learn mailing list