Deep trees overfit. Use min samples to prevent tiny splits.
Each colored region is a leaf - the tree assigns its majority class to all points there.
Decision Tree Splits - Interactive Visualization
A decision tree partitions the feature space with axis-aligned cuts, greedily choosing the split that maximally reduces impurity (measured by entropy or Gini) at each step. Each internal node asks a yes/no question about one feature, and leaf nodes hold the class prediction or regression value. Controlling tree depth is the primary lever against overfitting.
See each split drawn on the 2D feature space and the corresponding node added to the tree diagram
Compare entropy vs Gini impurity as splitting criteria - watch how they affect tree structure
Grow the tree to full depth and see it memorize training data, then prune it back to reduce overfitting
Understand information gain: the tree always picks the question that reduces uncertainty the most
Learn why shallow trees are interpretable and why deep trees overfit - the fundamental bias-variance tradeoff in tree models
Part of the EngineersOfAI Interactive 3D - free interactive visualizations covering every major concept in machine learning and AI engineering. Hover any element for a plain-English explanation. No code required.