HomeAI & Machine LearningStacking Ensembles: Meta-Learner Blending

Stacking Ensembles: Meta-Learner Blending (2D)

Interactive 2D stacking-ensemble simulator: three real base learners (x-only linear regression, y-only kernel k-NN, and a decision stump) are trained from scratch on a synthetic dataset, a real logistic-regression meta-learner is trained on their honest held-out predictions, and a live bar chart compares measured test error of each base model, simple averaging, and the trained stacked ensemble.

AI & Machine Learning2DAdvanced60 FPS📱 Mobile-adapted⇄ 3D version
2d-ds-topic-39 ↗ Open standalone

Stacked generalization combines several different models by training a second-level "meta-learner" on top of their predictions rather than simply averaging or voting. This 2D canvas simulator fits three genuinely different base learners on a held-out slice of a synthetic two-class dataset whose true boundary runs diagonally through both features — a least-squares linear regression that only ever looks at the x-axis, a kernel-weighted nearest-neighbor classifier that only ever looks at the y-axis, and a threshold-search decision stump that picks whichever single axis works best. Because each base learner is missing real information the others have, it collects their honest out-of-sample predictions on a second held-out slice and trains a logistic-regression meta-learner on those predictions. A live bar chart then measures and compares real test error for every base model individually, for simple unweighted averaging, and for the trained stacked ensemble — making visible why a trained combination of partial-information models reliably beats any one of them alone.

⚙ Under the hood

Train three real base learners — kernel k-NN, logistic regression and a decision stump — then blend them with a logistic-regression meta-learner, comparing naive in-sample stacking against honest K-fold cross-validated stacking on a live 3D probability surface.

ensemble learningstackingmeta-learnercross-validationlogistic regressionoverfitting

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)