The most explainable model in machine learning is just a stack of yes/no questions. Watch a real tree grow on 2D data: the questions on one side, the map they carve on the other, and a depth slider that shows exactly how trees overfit.
Ask a series of yes/no questions, and at the end give an answer: that is a decision tree, the most human-readable model in machine learning. "Is the transaction over $500? Is it from a new device? Then flag it." This tool trains a real tree on 2D data and shows you both faces of the same model at once: the flowchart of questions, and the map of rectangular regions those questions carve out of the plane.
At every node the algorithm tries every possible split on both features and keeps the one that leaves the two resulting groups as pure as possible, measured by Gini impurity (roughly, how mixed the labels are). Then it repeats inside each group, until it hits your depth limit or the groups are already pure. Nothing is hand-tuned here; the questions in the flowchart were all discovered from the data, which is exactly what happens in production trees.
A single tree is rarely the most accurate model, but teams of trees dominate practical machine learning on tabular data: random forests average hundreds of them, and gradient boosting builds them one on top of another. Every one of those celebrated methods is made of exactly what you see here. Understand this page and the words "forest" and "boosting" stop being magic.
It asks a stack of yes/no questions about the features (is x bigger than 0.4?) and each answer routes toward a leaf that gives the prediction. This tool shows the same model two ways at once: the flowchart of questions and the map of rectangular regions those questions carve.
At every node the algorithm tries every possible question and keeps the one that leaves the purest groups, measured by Gini impurity (how mixed the labels are). Nothing here is hand-tuned; every question in the flowchart was discovered from the data, exactly as in production trees.
Each extra level lets the tree carve smaller rectangles, which can trace real structure or memorize noise. Set label noise to 20% and depth to 8: training accuracy climbs while test accuracy sags as tiny boxes wrap individual mislabeled points. Then lower the depth and watch the test score recover.
Every question involves one feature at a time, so every split is axis-aligned. On the diagonal dataset you can watch the tree approximate a slanted boundary with a staircase of little rectangles, the tree family's signature limitation.
Because random forests and gradient boosting (XGBoost, LightGBM), which dominate practical machine learning on tabular data, are built entirely out of these trees. Understand one tree and those famous methods stop being magic.