Home▸Machine Learning & Neural Networks▸Decision Tree Trainer (2D)

Decision Tree Trainer (2D)

A 2D companion to the 3D Decision Tree Live lab: click to place your own labelled points and watch a real CART algorithm search every candidate threshold, pick the split that minimises Gini impurity, and carve the plane into the axis-aligned rectangular regions the tree actually predicts.

Machine Learning & Neural Networks2DEasy60 FPS📱 Mobile-adapted⇄ 3D version
2d-decision-tree ↗ Open standalone

This is the 2D companion to the 3D Decision Tree Live lab. Instead of an auto-generated dataset and an orbiting 3D scene, you build the dataset yourself: click anywhere on the plane to drop a point of the active class, and a genuine CART decision tree is grown from your points in real time. The algorithm evaluates every candidate split threshold on both axes, picks the one that minimises Gini impurity at each node, and recurses until it hits the max-depth cap, runs out of samples, or reaches a pure node. The coloured rectangles are the tree's actual predicted regions — move a point, add more, or raise the depth slider and watch the boundary redraw as the real split search re-runs.

⚙ Under the hood

The 2D companion to Decision Tree Live: click to place your own labelled points and watch a real CART algorithm evaluate every candidate split threshold, pick the one that minimises Gini impurity at each node, and carve the plane into the axis-aligned rectangular regions the tree actually predicts, with an adjustable max-depth slider.

decision treeCARTgini impurityclassificationmachine learningsupervised learningdecision boundary2d

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

What did you find?

Add reproduction steps (optional)