Case Study 13

Decision Tree from Scratch

Multi-class decision-tree classifier implemented in NumPy

2025
PythonNumPyPandasScikit-learn
Key impact
Implemented a multi-class decision-tree classifier from scratch — entropy and information-gain split selection, recursive tree construction, majority-vote leaves, and prediction traversal — in NumPy/Pandas.
DECISION TREEx₂ ≤ 1.4x₁ ≤ 0.7x₃ ≤ 2.1ABABentropy / information-gain splits
Representative mockup

What I did

3
  1. 01

    Implemented a multi-class decision-tree classifier from scratch — entropy and information-gain split selection, recursive tree construction, majority-vote leaves, and prediction traversal — in NumPy/Pandas.

  2. 02

    Validated correctness against scikit-learn's DecisionTreeClassifier on the Iris dataset.

  3. 03

    Exposed depth and splitting behavior to illustrate the overfitting-vs-generalization tradeoff.

Tech stack

PythonNumPyPandasScikit-learn