Stacking with Out-of-Fold Predictions

medium
Unit 12 · Ensembles & Model Selection0/3 to milestone

Stacking trains a meta-model on the predictions of several base models. The meta-model must be trained on out-of-fold predictions (each row predicted by a model that never saw it); otherwise it learns to trust overfit models.

Pro problem

Unlock this and every premium problem across all tracks — plus hidden-test grading, advanced AI engineering modules and new content every week.

Start 7-day free trial
solution.py · Python 3.13
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Stacking with Out-of-Fold Predictions · TechGradify