LearnMachine learning
Decision tree
Split the data with simple yes or no questions, and see how a deeper tree starts memorising noise.
Filled dots train the tree; hollow dots are held back to test it. Click to add training points in the chosen colour.
How it works
Twenty questions, learned from data.
A decision tree classifies by asking a chain of yes or no questions, such as: is x bigger than 4.2? Each answer leads to another question until it reaches a decision.
To grow the tree, it tries every possible question and keeps the one that splits the points into the purest groups, measured by Gini impurity. Then it repeats the same search inside each group.
A deep tree can memorise the training points perfectly, noise included, and then do worse on new data, like the hollow test points. Limiting the depth keeps it honest, and many trees voting together make a random forest.