Learn a decision tree as a sequence of questions that progressively removes uncertainty.
A university-style path from hand-calculated entropy to mixed-data classification, recursive fitting, pruning, regression trees, evaluation, and practical model choice.
The central learning question
Opening question
If several questions can divide the same training data, how should a tree decide which question to ask first?
A tree tries each allowed question and measures how much cleaner the labels become. For classification, entropy or Gini measures the mixture. Information gain measures the reduction.
Intuition: ask the question that removes the most uncertainty now, then repeat the same idea inside each resulting group.
Every root-to-leaf path corresponds to one region of feature space.
Three connected examples
Play cricket?
A tiny categorical dataset for complete entropy and information-gain calculations.
Approve a loan?
A mixed numerical and categorical dataset for thresholds, recursion, prediction, and fairness.
Predict house price
A regression example for means, squared error, piecewise predictions, and extrapolation.
Session story
The mathematical expression on every page is followed by its symbols, numerical substitution, plain-language intuition, and a visual consequence.
Roadmap
Intuition and anatomy
Questions, branches, leaves, regions, classification, and regression.
Entropy and Gini
Uncertainty, surprise, impurity curves, and complete calculations.
Information gain
Weighted child entropy and the complete cricket root split.
Mixed-data splits
Loan data, numeric thresholds, categories, and tie-breaking.
Recursion
Tree growth, stopping cases, prediction paths, and probabilities.
Pruning
Underfitting, overfitting, pre-pruning, and cost complexity.
Regression trees
SSE reduction, leaf means, step functions, and limitations.
Evaluation
Metrics, cross-validation, tuning, imbalance, and calibration.
Practice
Preprocessing, missing values, interpretation, and workflows.
Model choice
When trees work, when they struggle, nuances, and ensembles.