Reputation: 7922
I am doing multiple target regression, so I want to predict several numbers simultaneously. The numbers are highly correlated, so I think predicting their PC's is a more sensible approach.
Using sklearn's Pipeline is great for daisy-chaining together the MinMaxScaler, PCA, and the regressor I want to use; and then allowing me to call that Pipeline to make predictions.
However, does that Pipeline apply PCA to the inputs only? Is it possible to use the same strategy, but also have it perform PCA on the outputs that I want to predict too?
Upvotes: 2
Views: 322
Reputation: 9390
No, it is possible to use steps in pipeline only for transforming X argument. You may create additional pipeline for y, where all steps should be transformers, and then feed result of this pipeline as y to a classifier.
Upvotes: 2