Pregunta

So I am currently working on a Data set, and I want to use Pipelines to select the transforms. Here is an example of what I want to do :

# I missed the imports just for brevity
pipeline = make_pipeline(StandardScaler(), PolynomialFeatures(), PCA(), LogisticRegression())

So what I want to do, I want to try both StandardScaler, MinMaxScaler and no scaler when I am using other methods such as XGBOOST. Then I want to try to use polynomial features and then use a PCA, only if I used polynomial features. And finally, I want to try Logistic Regression and XGBOOST with GridSearch (This last part I know how to do).

Anybody did something similar? Thank you!

¿Fue útil?

Solución 2

There is an example of this here:

https://iaml.it/blog/optimizing-sklearn-pipelines

Otros consejos

The purpose of the pipeline is to assemble several steps that can be cross-validated together while setting different parameters. For this, it enables setting parameters of the various steps using their names

Check the docs

For your requirement, you will have to create multiple pipelines, you cannot do it via single pipeline.

Licenciado bajo: CC-BY-SA con atribución
scroll top