Apex › Storage & databases

How a decision tree splits data (Gini)

A flowchart of yes/no threshold questions (“is x > 0.45?”) that carve the plane into axis-aligned regions, each split chosen greedily to most reduce Gini impurity. Then produce its defining failure: with noisy data and a held-out TEST set, slide the depth up — TRAIN accuracy climbs to 100% (the tree boxes every point, memorizing even the noise) but TEST accuracy peaks shallow (~depth 2) and then FALLS as the regions fracture into slivers around single points. A live curve shows the two diverge; that widening gap is overfitting. The fix is to stop early (cap depth / prune) or average many trees (a random forest). Node-verified: train 80→100%, test peaks 82% then drops to ~74%.

More in Storage & databases