// interactive walkthrough
How a Decision Tree trains — one split at a time
Pick a dataset and an impurity criterion, then watch the tree grow split by split. Every node shows its impurity; every split shows the information-gain calculation that picked it, with the full table of evaluated candidates ranked by gain. Small enough that you can verify the math by hand.
settings changed — tree has been reset to apply.
01
Task & impurity criterion
// what we measure to pick splits
task
criterion
02
Hyperparameters
// drag to tune · changes reset the tree
03
Training controls
// advance one split, or grow the whole tree
data & current prediction
tree being grown
click ▷ Next split to start.
internal (split)
leaf (prediction)
last action
04
Why this split?
// impurity reduction math for the highlighted nodeBuild a split to see the impurity-reduction calculation here.
05
Cost-complexity pruning
// post-hoc: drag ccp_alpha to walk the pruning pathGrow the tree first (or click ⏭ Grow to end), then walk the pruning path with the slider here.
training fit
predictions vs actuals
06
Split history
// one row per split, in growth orderNo splits yet.