aNet.ai
Data Science/Lab work
0day streak0XP · Lv 1
← Lab 3 overview and setup
Lab 3 · Section 6 of 6

Audit, report and transfer

Q9–Q10 · 15 points

First · connect to the lecture

The lecture's audit trail becomes a final report. Structural checks verify stated rules, while source accuracy and broader claims still need separate evidence.

Week 3: assertions, logs and reporting, PDF pp. 46–55

Your task

Run final checks. Write the 100–150 word report and 60–100 word answer to your generated challenge, using your own version.

Evidence to include

Include row counts, mean in points, valid n, missing count, two log entries, and separate missingness/accuracy limitations.

Notebook questions and code

Read here; run in your downloaded notebook. Start with its setup cells and run in order. Use your own ID and outputs where requested.

Download Lab 3 notebook

6 · Audit, report, and transfer your understanding

Run the checks after returning to your final cleaning policy. A failed check is useful feedback: inspect your decision settings and rerun Part 2, then this cell. You do not need to rewrite the checks.

Python · cell 25 — read here, run in your notebook
checks = {
    "One row per student": clean.student_id.is_unique,
    "All expected students retained": set(clean.student_id)==set(ids),
    "IDs remain five-character text": clean.student_id.map(lambda x:isinstance(x,str) and len(x)==5).all(),
    "Only approved programmes": clean.programme.isin(["Biology","Bioengineering","Economics"]).all(),
    "Observed scores within 0–100": clean.entry_score.dropna().between(0,100).all(),
    "Observed ages within dictionary range": clean.age.dropna().between(16,100).all(),
    "Unresolved scores remain missing": clean.loc[clean.score_status!="observed","entry_score"].isna().all(),
    "Raw export unchanged": raw.equals(raw_snapshot),
    "Row removals reconciled": len(raw)-len(clean)==sum(x["affected"] for x in log if x["unit"] in ["row removed","rows removed"]),
}
display(pd.DataFrame({"check":checks.keys(),"passed":checks.values()}))
print("Final rows:",len(clean),"| Observed scores:",clean.entry_score.count(),"| Missing scores:",clean.entry_score.isna().sum())
print("Observed entry-score mean:",round(clean.entry_score.mean(),2),"points out of 100")
assert all(checks.values()), "Review failed checks and your policies; rerun Part 2 and then this cell."
print("Structural checks passed. Accuracy still requires source evidence.")

Your explanation

Q9 · Final report and audit (8 points). Write 100–150 words for a reader who has not opened your notebook. Include:

  • your version code; target population; raw/final row counts;
  • key actions with evidence, distinguishing row removal from value flagging;
  • observed entry-score mean, its unit, valid n, and missing count;
  • one limitation about missingness and one about accuracy.

Then cite two entries in the generated cleaning log. Explain why passing every check does not prove that every stored score matches the actual exam.

Write here: …

Python · cell 27 — read here, run in your notebook
challenge = [
    "An analyst replaces every missing phone with 0 and deletes students with missing scores before counting programmes. Evaluate BOTH decisions for the programme-count question.",
    "A new weekly-assessment export has two rows per student, one per week. An analyst reuses the current-registry rule and keeps only the latest. Explain what is lost and define the correct key.",
    "An analyst merges Bioengineering into Biology because both start with Bio, then reports that all validity checks pass. Explain the semantic error and why a check can miss it."
][seed % 3]
print("YOUR CHANGED-CASE CHALLENGE:", challenge)

Your explanation

Q10 · Independent transfer (7 points). Answer your displayed challenge in 60–100 words. Give (a) the problem, (b) a better action and supporting evidence needed, and (c) a consequence for the conclusion. Finally name one answer in this lab you changed after inspecting evidence, or explain why you retained your initial answer.

Write here: …

Saved only in this browser. This note doesn’t fill in the downloaded notebook; “reviewed” is a personal checklist, not a grade.

aNet.ai · Data Science Fundamentals · Weeks 1–5 · practice material, not an official examProgress saved in this browser