Level 0 project
Data Detective: Build and Explain a Tiny Predictor
Start from the canonical project files, validate the result, and keep the evidence you need to explain what you built.
There is no upload or grading service. Run the documented validator or checks where applicable, keep the results, and score your own evidence against the rubric below. A passing check by itself does not mean the project is complete. Suggested strong-evidence target: 90/100. For the p00 Core browser path, the canonical Lab evidence replaces the local Python validator.
Start here
Launch lesson: Debug and Improve a Tiny Predictor
No prerequisite Project.
Example only: Read a strong evidence report. Use your own numbers and observations in your submission.
Prerequisites
Python help for this project (optional Builder path only):
Complete Level 0 through L0.12, Debug and Improve a Tiny Predictor. You should be able to identify features and labels, explain a train/test split, count prediction mistakes, compare against a baseline, and change one thing at a time.
You have two valid completion paths. The Level 0 learning goal is experimental reasoning, so local Python is not required for Core completion.
Goal
Demonstrate that you can define a tiny prediction task, preserve fair evaluation evidence, compare a baseline, investigate a failure, and explain what the evidence does and does not support.
Task
Path A — Core: browser evidence + explanation
Use this path if you have not learned repository, terminal, or Python implementation workflow yet.
- Open L0.12, Debug and Improve a Tiny Predictor, and run its Lab unchanged.
- Record the starter
debug_record, especiallybefore,after, andbaseline. - Find
candidate_threshold = 3in the Lab and change only3to2. - Before running, predict what will happen to input
2. - Run again and record the new
before,after, andbaselinevalues. - Fill in the Core Evidence Report template, CORE_REPORT_TEMPLATE.md. To get it as a file, open the Data Detective project page, choose Download project files, and unzip the download; the template is inside. You can also open the template link and copy its prompts into your own document.
This path is complete when your evidence report demonstrates all five rubric areas. There is no upload or grading service: you keep the report and score it yourself against the rubric on the project page. You do not need to implement Python functions or run a terminal validator for the Core path.
Path B — Builder: local Python implementation
Use this path when you want to practice turning the same reasoning into code.
If repository/terminal workflow is new, read the Project Workbench first. It explains the repository root, terminal, validator, and the setup-debugging order.
Setup
No third-party packages are required. Use Python 3.11+ from the repository root.
Open projects/starters/l00/data_detective.py and complete the marked TODOs.
Your program must:
- treat the numeric measurement as the feature and
readyas the label; - choose a threshold using only
TRAIN_EXAMPLES; - evaluate the chosen threshold on
TEST_EXAMPLESwithout tuning on the test answers; - compare test mistakes with a majority-label baseline learned from the training labels;
- produce a short report containing the chosen threshold, model mistakes, baseline mistakes, and a cautious conclusion;
- investigate the intentional
NOISY_TEST_EXAMPLESscenario and write a short debug note.
Builder deliverables
- completed
data_detective.py; - terminal output from the validation command;
- a short
debug-note.mdcontaining: observed failure, hypothesis, one change, result, and next step; - a 4–8 sentence explanation of what the held-out evidence supports and one limitation.
Builder validation
From the repository root, run:
python projects/tests/l00/validate_submission.py projects/starters/l00/data_detective.pyExpected success evidence ends with:
PASS: p00-data-detective objective checksThe checks are behavioral. Your printed wording does not need to match a reference solution exactly.
Stuck on a TODO?
Choose one function at a time. Hint 1 offers direction, hint 2 offers pseudocode, and hint 3 reveals only that function's reference implementation after confirmation.
data_detective.py: predict()
Try the starter function and run its validator before revealing the reference.
Hints for this TODO
data_detective.py: count_mistakes()
Try the starter function and run its validator before revealing the reference.
Hints for this TODO
data_detective.py: choose_best_threshold()
Try the starter function and run its validator before revealing the reference.
Hints for this TODO
data_detective.py: build_report()
Try the starter function and run its validator before revealing the reference.
Hints for this TODO
Validation
Run these commands from the downloaded Project folder or the public materials repository root.
python projects/tests/l00/validate_submission.py projects/starters/l00/data_detective.pyCompare with a reference
First complete your own TODOs and run the submission validator above. Then open the published reference solution. Reference acceptance tests check the completed reference, not your submission:
python projects/tests/l00/test_reference.pyRubric
This rubric maps directly to the Level 0 exit skills. Core and Builder are two evidence paths to the same learning outcome. You can earn full Level 0 credit on either path. Not having learned local Python or terminal workflow yet does not cost you points. Use this rubric to score your own work.
Accepted evidence paths:
- Core browser path: canonical L0.12 Lab evidence + completed Core Evidence Report;
- Builder local path: completed
data_detective.py+ validator evidence + debug/explanation deliverables.
Your work is scored on the reasoning and reproducibility that fit the path you chose. Writing more code does not earn extra conceptual credit.
1. Features and labels — 20 points
- 18–20: Correctly identifies the numeric input as the feature and the Boolean target as the label; explanation clearly distinguishes prediction from label.
- 12–17: Reasoning is mostly correct but explanation is incomplete or mixes one term.
- 1–11: Feature/label roles are confused in evidence or prose.
- 0: No usable evidence.
2. Train/test separation and fair evaluation — 20 points
- 18–20: Explains that the rule is chosen without using final held-out answers; held-out examples are used for evaluation; explains why repeated tuning on final test answers weakens independence.
- 12–17: Correct boundary with weak explanation, or one minor evaluation mistake that is identified and corrected.
- 1–11: Test answers guide model selection without recognizing the problem, or the split is not reproducible.
- 0: No train/test distinction.
3. Predictor, baseline, and objective evidence — 20 points
- 18–20 Core: Correctly records the canonical Lab's before/after/baseline evidence, traces the changed threshold to the changed prediction, and interprets the baseline fairly.
- 18–20 Builder: Objective validator passes; model and majority baseline are evaluated on the same held-out examples; result is interpreted correctly.
- 12–17: Predictor evidence and baseline are present with one small defect or incomplete interpretation.
- 1–11: A predictor result exists but the comparison is unfair, untraceable, or missing a baseline.
- 0: No functioning or inspectable predictor evidence.
4. Failure analysis and debugging — 20 points
- 18–20: Learner identifies a specific failure, states a plausible hypothesis, changes or checks one thing at a time, records evidence, and states a next step. The Core path may use the deliberate threshold
3 → 2unsuccessful change; the Builder path may useNOISY_TEST_EXAMPLES. - 12 –17: Failure is found and partially explained, but cause/evidence/next-step chain is incomplete.
- 1–11: Failure is hidden, fixed by unrelated changes, or discussed without evidence.
- 0: No debug attempt.
5. Reproducibility and communication — 20 points
- 18–20 Core: Records the canonical Lesson/Lab, exact one-line edit, before/after/baseline values, observation versus conclusion, and one limitation so another learner can repeat the browser experiment.
- 18–20 Builder: Provides validation command/output and enough settings/evidence to reproduce the local run; distinguishes observation from conclusion and states one limitation.
- 12–17: Mostly reproducible evidence with an incomplete record or limitation statement.
- 1–11: Result depends on undocumented changes or explanation makes claims broader than the evidence.
- 0: The work cannot be reproduced or explained.
Performance bands
- 90–100: Ready to advance; all Level 0 exit skills demonstrated.
- 75–89: Meets core outcome with one or two specific areas to strengthen.
- 60–74: Partial mastery; repeat the relevant Lesson/Lab before advancing.
- 0–59: Major Level 0 skills are missing; revise with rubric evidence.
A passing local validator is required only for the Builder local path. It is not a prerequisite for full Level 0 conceptual mastery on the Core browser path.
Self-check before you call it done
- Can you identify the feature, label, and exact rule and distinguish your prediction from the true label?
- Can you name the training and held-out examples and explain why revisiting the held-out answers is not an independent final test?
- Can you reproduce the Core Lab's before/after/baseline values and the
3 → 2failure, or show the Builder validator result and fair baseline? - Can you point to a failure → hypothesis → one check → result → next-step record and a limitation in your own report?