cs-135 — The Split That Leaks

FieldValue
idcs-135
difficultyExpert
topicsleakage, evaluation, communication
lecturelecture-28
estimated time5-minute attempt + 12-minute discussion
prerequisiteslecture-08 (testing mindset), lecture-09 (aggregation), lecture-28 (summaries)
objectivedetect and demonstrate leakage by tracing one student through two pipelines that disagree
solutionheld by the instructor; discussed after the attempt

Problem

A team builds a study-hours → pass/fail predictor for 40 students and reports: "test accuracy computed on 20 held-out rows." Their pipeline:

  1. Standardise the feature: scaled = (hours − mean) / sd, with mean and sd computed over all 40 rows.
  2. Rule: predict pass if scaled hours ≥ 0.
  3. Evaluate on a random 20-row test split carved from the same 40.

Your deliverables:

  1. In three sentences a non-technical dean would understand: why is the reported number optimistic?
  2. The minimal correct pipeline order (what is computed where).
  3. The worked demonstration below, by hand: one student whose pass/fail decision flips between the leaky and the correct pipeline.
  4. One further leak in this setup, beyond the scaling one.

The eight-row teaching dataset (feature = study hours; label in parentheses):

2 (fail)  4 (fail)  4 (fail)  6 (fail)
7 (pass)  10 (pass)  12 (pass)  14 (pass)

For the demonstration, take the test split to be the rows 2, 7, 12, 14 and the training split the other four rows (4, 4, 6, 10). Standardise the test row 7 twice — once with the mean and sd computed over all eight rows (leaky), once over the four training rows (correct) — and apply the rule each time.

If the problem is ambiguous anywhere, state the assumption you are making and carry on — a stated assumption is part of a good answer.

Examples

Solve for the worked instance first. Then ask what would change if one number, name, or condition were replaced by something stranger.

What to notice

Discussion starter

After the solution is revealed, the class spends five minutes on this prompt: "The team answers: 'the flip is one student out of forty — immaterial.' Draft your two-sentence reply, using the pipeline order from deliverable 2, not rhetoric."

Constraints and assumptions

Hints and extension