Decision Tree
The foundation of Random Forests and XGBoost! Learn how decision trees recursively split data using information gain, Gini impurity, and entropy. Watch the tree grow and classify data interactively.
Decision Tree VisualizerDepth: 2
Tree Parameters
Controls
Tree Info
Decision Space
Tree Structure
Gini Impurity
Gini = 1 - Σ(p²)
Measures how often a randomly chosen element would be incorrectly labeled. Range: [0, 0.5]
Entropy
H = -Σ(p × log₂(p))
Measures disorder/randomness. From information theory. Range: [0, 1]
Information Gain
IG = Impurity(parent) - Weighted(children)
How much uncertainty is reduced by the split. Algorithm maximizes this!
Grow one node
Order how a tree chooses a split.
Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.
- 1Drop a step here
- 2Drop a step here
- 3Drop a step here
- 4Drop a step here
- 5Drop a step here
Test your knowledge
A decision tree makes predictions by…
Interview Questions
Love this visualization?
Sign up to track your progress, earn achievements, use the AI assistant, and access your personal learning dashboard.
100% free • No credit card required