XGBoost with GridSearchCV, Scaling, PCA, and Early-Stopping in sklearn Pipeline
问题 I want to combine a XGBoost model with input scaling and feature space reduction by PCA. In addition, the hyperparameters of the model as well as the number of components used in the PCA should be tuned using cross-validation. And to prevent the model from overfitting, early stopping should be added. For combining the various steps, I decided to use sklearn's Pipeline functionalities. At the beginning, I had some problems making sure, that the PCA is also applied to the validation set. But I