Use a pipeline and a genuinely held-out set
A library pipeline fits transformations and a predictor together, reducing accidental leakage. Cross-validation belongs inside the training partition. A final holdout is a one-time audit, not a tuning dashboard.
Python + statistics · 4h estimated · six activities
Before you begin
- Python + statistics; inspect the worked fixture before beginning.
- A text editor/spreadsheet for the manual route. Hosted Python/Jupyter for code exercises; applicable dependencies are in requirements.txt.
- For actual AI calls, a legitimate available cloud service and authorised learner credentials; no particular provider or country is mandatory.
Free original, non-accredited practice. Self-review is not independent assessment. No particular provider, payment platform or country is mandatory; use a legitimate available route or explicitly labelled manual practice.
Reserve a final holdout
A library pipeline fits transformations and a predictor together, reducing accidental leakage. Cross-validation belongs inside the training partition. A final holdout is a one-time audit, not a tuning dashboard. Write the split and allowed tuning procedure before fitting. Inspect the supplied input before using any tool. Write the decision rules in your own words and calculate one small result independently. The reference output is an answer key for this deliberately bounded fixture, not proof of general capability. Policy for this project: This tiny separable synthetic fixture is a wiring test only. Fit StandardScaler and LogisticRegression on six rows; predict four held-out rows. Record versions and do not generalise the resulting score. For learners across regions underserved or excluded by mainstream providers: verify country eligibility, language, account/identity requirements, data terms, cost, quota and connectivity before choosing a cloud service. Use only legitimate available alternatives; never bypass restrictions or invent a country/account. No service access? Complete the labelled manual/fixture route without claiming a live AI run.
Worked example
SOURCE (authored fixture):
{
"train_x": [
[
0
],
[
1
],
[
2
],
[
8
],
[
9
],
[
10
]
],
"train_y": [
0,
0,
0,
1,
1,
1
],
"test_x": [
[
0.5
],
[
1.5
],
[
8.5
],
[
9.5
]
],
"test_y": [
0,
0,
1,
1
]
}
INDEPENDENT FIXTURE TARGET:
{
"predictions": [
0,
0,
1,
1
],
"correct": 4,
"test_count": 4
}Your practical task
- Write the split and allowed tuning procedure before fitting.
- Open input.json and expected.json from the practice pack; keep an unmodified original.
- Record a manual prediction and the relevant rule before consulting the answer key.
- Perform one small change and predict its effect before rerunning.
- Keep the result and your reasoning in the lesson notes; do not mark a simulated run as live.
Evidence to keep
- Reserve a final holdout — a saved, inspectable artefact tied to the supplied rule.
- A baseline or change-test record with expected/observed results and a limitation.
Mistakes to watch for
- Move a test point near the class boundary: inspect uncertainty instead of demanding a perfect score.
- Treating a supplied answer key, an authored example or self-review as independent field validation.
Check your understanding
Which exact input, rule and expected value would let another learner falsify your conclusion in this activity, and what remains untested?
No-service / offline route
Use the supplied fictional JSON, expected results and paper/text evidence log without a provider account. Manual or constructed completion is labelled; it is not a live cloud integration or trained-model run.
Fit the simplest baseline
A library pipeline fits transformations and a predictor together, reducing accidental leakage. Cross-validation belongs inside the training partition. A final holdout is a one-time audit, not a tuning dashboard. Compare against majority class and transparent rules. Establish a baseline before changing prompts or code. Keep the original input immutable. Record expected values, observed values and whether each comparison passed. If the expected file conflicts with a justified policy, investigate rather than forcing a convenient match. Policy for this project: This tiny separable synthetic fixture is a wiring test only. Fit StandardScaler and LogisticRegression on six rows; predict four held-out rows. Record versions and do not generalise the resulting score.
Worked example
MANUAL BASELINE / compare every named field
{
"predictions": [
0,
0,
1,
1
],
"correct": 4,
"test_count": 4
}
Keep a separate observed-result column; the answer key is not a model response.Your practical task
- Compare against majority class and transparent rules.
- Open input.json and expected.json from the practice pack; keep an unmodified original.
- Record expected and observed values separately; explain every mismatch.
- Perform one small change and predict its effect before rerunning.
- Keep the result and your reasoning in the lesson notes; do not mark a simulated run as live.
Evidence to keep
- Fit the simplest baseline — a saved, inspectable artefact tied to the supplied rule.
- A baseline or change-test record with expected/observed results and a limitation.
Mistakes to watch for
- Scale on all rows before splitting: identify leakage.
- Treating a supplied answer key, an authored example or self-review as independent field validation.
Check your understanding
Which exact input, rule and expected value would let another learner falsify your conclusion in this activity, and what remains untested?
No-service / offline route
Use the supplied fictional JSON, expected results and paper/text evidence log without a provider account. Manual or constructed completion is labelled; it is not a live cloud integration or trained-model run.
Compose preprocessing and model
A library pipeline fits transformations and a predictor together, reducing accidental leakage. Cross-validation belongs inside the training partition. A final holdout is a one-time audit, not a tuning dashboard. Use a pipeline so training parameters stay within the correct partition. Build one inspectable transformation or bounded AI prompt. Keep calculation and validation deterministic where possible. If you make a permitted hosted call, save the actual response separately from the authored examples and verify its material claims; the supplied reference never simulates a live model. Policy for this project: This tiny separable synthetic fixture is a wiring test only. Fit StandardScaler and LogisticRegression on six rows; predict four held-out rows. Record versions and do not generalise the resulting score.
Worked example
PROJECT CONTRACT:
This tiny separable synthetic fixture is a wiring test only. Fit StandardScaler and LogisticRegression on six rows; predict four held-out rows. Record versions and do not generalise the resulting score.
HOSTED REFERENCE: open hosted-lab.ipynb or run reference.py with all fixture files together.
EXPECTED CONSTRUCTED RESULT:
{
"predictions": [
0,
0,
1,
1
],
"correct": 4,
"test_count": 4
}Your practical task
- Use a pipeline so training parameters stay within the correct partition.
- Open hosted-lab.ipynb and the reference code from the practice pack; keep an unmodified original.
- Record expected and observed values separately; explain every mismatch.
- Perform Try another seed or a harder dataset: keep the new result even if performance drops.
- Keep the result and your reasoning in the lesson notes; do not mark a simulated run as live.
Evidence to keep
- Compose preprocessing and model — a saved, inspectable artefact tied to the supplied rule.
- A baseline or change-test record with expected/observed results and a limitation.
Mistakes to watch for
- Try another seed or a harder dataset: keep the new result even if performance drops.
- Treating a supplied answer key, an authored example or self-review as independent field validation.
Check your understanding
Which exact input, rule and expected value would let another learner falsify your conclusion in this activity, and what remains untested?
No-service / offline route
Use the supplied fictional JSON, expected results and paper/text evidence log without a provider account. Manual or constructed completion is labelled; it is not a live cloud integration or trained-model run.
Inspect predictions and errors
A library pipeline fits transformations and a predictor together, reducing accidental leakage. Cross-validation belongs inside the training partition. A final holdout is a one-time audit, not a tuning dashboard. A four-point synthetic success checks wiring, not field reliability. Change one assumption at a time and predict the result first. Retain the failure, the revision and the rerun evidence. A failure is useful information: hiding a bad output or editing a test target after seeing the answer destroys the value of the experiment. Policy for this project: This tiny separable synthetic fixture is a wiring test only. Fit StandardScaler and LogisticRegression on six rows; predict four held-out rows. Record versions and do not generalise the resulting score.
Worked example
CHANGE TESTS — predict before running: 1. Move a test point near the class boundary: inspect uncertainty instead of demanding a perfect score. 2. Scale on all rows before splitting: identify leakage. 3. Try another seed or a harder dataset: keep the new result even if performance drops. Keep the original expected.json unchanged.
Your practical task
- A four-point synthetic success checks wiring, not field reliability.
- Open failure-tests.md from the practice pack; keep an unmodified original.
- Record expected and observed values separately; explain every mismatch.
- Perform Move a test point near the class boundary: inspect uncertainty instead of demanding a perfect score.
- Keep the result and your reasoning in the lesson notes; do not mark a simulated run as live.
Evidence to keep
- Inspect predictions and errors — a saved, inspectable artefact tied to the supplied rule.
- A baseline or change-test record with expected/observed results and a limitation.
Mistakes to watch for
- Move a test point near the class boundary: inspect uncertainty instead of demanding a perfect score.
- Treating a supplied answer key, an authored example or self-review as independent field validation.
Check your understanding
Which exact input, rule and expected value would let another learner falsify your conclusion in this activity, and what remains untested?
No-service / offline route
Use the supplied fictional JSON, expected results and paper/text evidence log without a provider account. Manual or constructed completion is labelled; it is not a live cloud integration or trained-model run.
Compare validation schemes
A library pipeline fits transformations and a predictor together, reducing accidental leakage. Cross-validation belongs inside the training partition. A final holdout is a one-time audit, not a tuning dashboard. Explain when random versus time-based splits are appropriate. Review what the fixture cannot establish. Explain who owns the decision, where human approval is needed and which access or professional constraints remain. Do not describe a small educational success as production readiness, certification, legal compliance or a guarantee. Policy for this project: This tiny separable synthetic fixture is a wiring test only. Fit StandardScaler and LogisticRegression on six rows; predict four held-out rows. Record versions and do not generalise the resulting score. For learners across regions underserved or excluded by mainstream providers: verify country eligibility, language, account/identity requirements, data terms, cost, quota and connectivity before choosing a cloud service. Use only legitimate available alternatives; never bypass restrictions or invent a country/account. No service access? Complete the labelled manual/fixture route without claiming a live AI run.
Worked example
REVIEW BOUNDARY: This tiny separable synthetic fixture is a wiring test only. Fit StandardScaler and LogisticRegression on six rows; predict four held-out rows. Record versions and do not generalise the resulting score. ACCESS / NOT TESTED: unavailable provider, unsupported language and absent external feedback must remain explicit.
Your practical task
- Explain when random versus time-based splits are appropriate.
- Open README.md and your evidence log from the practice pack; keep an unmodified original.
- Record the human decision owner, limitations and any untested service access.
- Perform one small change and predict its effect before rerunning.
- Keep the result and your reasoning in the lesson notes; do not mark a simulated run as live.
Evidence to keep
- Compare validation schemes — a saved, inspectable artefact tied to the supplied rule.
- A baseline or change-test record with expected/observed results and a limitation.
Mistakes to watch for
- Scale on all rows before splitting: identify leakage.
- Treating a supplied answer key, an authored example or self-review as independent field validation.
Check your understanding
Which exact input, rule and expected value would let another learner falsify your conclusion in this activity, and what remains untested?
No-service / offline route
Use the supplied fictional JSON, expected results and paper/text evidence log without a provider account. Manual or constructed completion is labelled; it is not a live cloud integration or trained-model run.
Ship a versioned experiment bundle
A library pipeline fits transformations and a predictor together, reducing accidental leakage. Cross-validation belongs inside the training partition. A final holdout is a one-time audit, not a tuning dashboard. Include parameters, held-out predictions, software versions and a model card. Deliver a reproducible bundle rather than a screenshot alone. Include inputs, rules, output, failure tests, a short README and residual limitations. Ask another person to follow the instructions if possible; self-review and actual external review must be labelled separately. Policy for this project: This tiny separable synthetic fixture is a wiring test only. Fit StandardScaler and LogisticRegression on six rows; predict four held-out rows. Record versions and do not generalise the resulting score.
Worked example
HANDOFF MANIFEST: input.json — immutable source expected.json — fixture answer key actual.json — result actually observed evidence-log.csv — baseline plus three changes README.md — reproduction and access route limitations.md — unresolved failures, rights, approvals and scope Never bundle a credential.
Your practical task
- Include parameters, held-out predictions, software versions and a model card.
- Open README.md and your evidence log from the practice pack; keep an unmodified original.
- Record the human decision owner, limitations and any untested service access.
- Perform one small change and predict its effect before rerunning.
- Keep the result and your reasoning in the lesson notes; do not mark a simulated run as live.
Evidence to keep
- Ship a versioned experiment bundle — a saved, inspectable artefact tied to the supplied rule.
- A baseline or change-test record with expected/observed results and a limitation.
Mistakes to watch for
- Try another seed or a harder dataset: keep the new result even if performance drops.
- Treating a supplied answer key, an authored example or self-review as independent field validation.
Check your understanding
Which exact input, rule and expected value would let another learner falsify your conclusion in this activity, and what remains untested?
No-service / offline route
Use the supplied fictional JSON, expected results and paper/text evidence log without a provider account. Manual or constructed completion is labelled; it is not a live cloud integration or trained-model run.
Capstone self-review
Score each criterion 0 (missing), 1 (partial), or 2 (demonstrated). A self-review pass needs at least 8/10 and 2/2 on the critical safety/limits criterion. This is learner practice feedback, not verified assessment.
- Defined task and preserved input: Original input and the project policy are retained; the actual question is clear.
- Checked baseline: The supplied baseline reconciles field by field; unsupported live-run claims are absent.
- Three failure/change tests: All three specified changes have predictions, observed results and explanations.
- Repeatable handoff: Another person can follow the README; supporting practice evidence and unresolved limits are included.
- Safety, rights and access honesty — critical: This tiny separable synthetic fixture is a wiring test only. Fit StandardScaler and LogisticRegression on six rows; predict four held-out rows. Record versions and do not generalise the resulting score. Regional access route is legitimate; credentials and private data are absent; manual/constructed work is clearly labelled.
Review questions
For the supplied fixture, what is the expected predictions?
[0, 0, 1, 1]
The independent answer key only validates this constructed fixture. Preserve the source, rerun counterexamples, and disclose what was not tested.
How should you handle the project rule: This tiny separable synthetic fixture is a wiring test only. Fit StandardScaler and LogisticRegression on six rows; predict four held-out rows. Record versions and do not generalise the resulting score.
State the rule, test it, and record exceptions or unresolved failures.
Rules, source provenance and counterexamples make an output inspectable; an attractive result does not override policy.
If mainstream providers do not serve your region, what is the honest route?
Check legitimate available alternatives, or label the manual/fixture route and its limits.
Access includes country, identity, language, cost and data terms. Do not bypass restrictions or invent a live result.
Practice files
- README.md
- evidence-log.csv
- expected.json
- failure-tests.md
- hosted-lab.ipynb
- input.json
- lab_engine.py
- reference.py
- requirements.txt
References and editorial limits
Original authored practice material; deterministic fixtures build-tested. Not independently expert-reviewed or learner-validated. Time estimates unvalidated.