Skip to content
Advertisement

Scaler fitted in a pipeline turns out to be not fitted yet

Please consider this code:

JavaScript

I get this message:

JavaScript

Why is the scaler not fitted?

Advertisement

Answer

When passing a pipeline or an estimator to RFE, it essentially gets cloned by the RFE and fit until it finds the best fit with the reduced number of features.

To access this fit estimator you can use fit_pipeline = rfe.estimator_

But note, this new pipeline uses the top n_features_to_select features.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement