# Cross Validation in StackingClassifier Scikit-Learn

In Scikit-Learn StackingClassifier documentation it's written:

Note that estimators_ are fitted on the full X while final_estimator_ is trained using cross-validated predictions of the base estimators using cross_val_predict.

... the default 5-fold cross validation

My question, why use 5-fold cross-validation only in the final estimator? why isn't final estimator fitted on the full X' (output from base estimators)?

• I see.., overfitting in each base estimators is not really a problem because there are some estimators. So I think it's okay if we use cross-validation at the "outside" of the stacking model, right? I mean, both base and final estimators are trained with full $X_i$, where $X_i$ is the train set in the $i$-th fold – malioboro Aug 30 '20 at 5:12