Decision Tree Trainer (2D)

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.