Skip to content

CMU 10-301 HW4: Turn Logistic Regression Likelihood into a Classifier

Aug 22, 2026 1 min
TL;DR HW4 joins probabilistic interpretation, cross-entropy gradients, and implementation into one traceable training pipeline.
Table of Contents
  1. Capability checkpoint
  2. First executable action and completion
  3. References

🌏 中文版

The official handout inside the ZIP is titled Homework 4: Logistic Regression and contains written plus programming work. Written sections cover linear regression, logistic-regression warm-up/analysis/adversarial attack, vectorization and pseudocode, word embeddings and gender biases, and empirical questions. Programming first uses feature.py to average GloVe vectors for Yelp sentiment text, then lr.py trains logistic regression. The ZIP provides both starters and glove_embeddings.txt; course data and selected references are not inside this public ZIP.

Capability checkpoint

Hand-compute one example's logit, probability, loss, and gradient, then reproduce every value in code. Final accuracy alone can conceal a wrong sign, averaging error, or mishandled bias. Log per-epoch loss and fix ordering and initialization.

First executable action and completion

Extract the bundle, then run python feature.py --help and python lr.py --help to inspect the starter interfaces. Because the public ZIP lacks Yelp splits, no honest command can complete the official pipeline from that ZIP alone. With legitimately obtained data, run finite-difference gradient checks. Completion requires reproducible feature files, a numerically checked single-example gradient, and all train/validation/test outputs; without course data and hidden tests, completion remains partial.

References