Abdoo13
Abdoo13

Reputation: 1

Cross Validation - Scaler Method not Being Applied in a Pipeline

I have an issue when doing some cross validation using Scikit Learn. I have build a pipeline consisting of 2 elements: a scaler and a regression model.

My issue is that I found out that the scaler method that I had configured in the pipeline was not applied (i.e.; taken into account) during the calculations.

Please, check my notebook and tell what is wrong. Here's the link: https://colab.research.google.com/drive/1KHqHsDHNkGLj4e0u-EWY9oj00NXeO5u3?usp=sharing

And here's also the link to the dataset that I have used: https://drive.google.com/file/d/1nyx0BitzxBLQjsAAAxfHt-9SzKqk9dWv/view?usp=sharing

Best regards.

Upvotes: 0

Views: 165

Answers (1)

Ben Reiniger
Ben Reiniger

Reputation: 12582

The scaler is being applied. Scaling has no effect on an unpenalized linear regression, and so it is expected that the cross-validation scores would be the same. Compare with Lasso, where scaling does matter.

Upvotes: 1

Related Questions