Skip to content

CMU 10-301 HW2: From Information Calculations to a Complete Decision Tree

Aug 22, 2026 1 min
TL;DR HW2 moves from hand-calculated entropy and mutual information to an end-to-end tree learner, predictor, and evaluator.
Table of Contents
  1. Why the assignment is ordered this way
  2. First executable action and completion
  3. References

🌏 中文版

The official handout is titled Homework 2: Decision Trees and contains written plus programming work. Written sections cover function approximation, tree calculations, pseudocode, and empirical questions. Programming has an inspection.py entropy/majority-error tool and a decision_tree.py learner, predictor, evaluator, and tree printer. The ZIP supplies a decision_tree.py starter, heart/purchase/small datasets, and small depth-3 reference labels, metrics, and inspection output.

Why the assignment is ordered this way

Hand calculation exposes why a feature wins. Code exposes stopping rules, tie-breaking, and depth limits. Draw the small-data tree first and require the program to produce the same structure before tuning anything.

First executable action and completion

First create the inspection program and run the handout command:

python inspection.py small_train.tsv small_inspect.txt

Completion means matching the public inspection reference plus depth-3 labels, metrics, and printed tree, then passing your own separable, identical-feature, and tied-gain cases. Gradescope still evaluates private data.

References