0 · Exam map unit outline
Written Examination 50% · Weekly Coding Tasks 10% · Early-feedback MCQ 2% · Practice Coding Test 0% · Project Stage 1 Report 20% · Python Coding Test 10% · Project Stage 2 Poster 8%.
permitted-materials truth · DATA1002 Semester 2 2026 Unit Outline, assessment table“Written exam — Exam CLOSED book exam with MC and short essay questions”
Priority: definitions → relationship → quantities → mechanism → boundary. The final is the 50% row: two-hour MCQ and short essay, with a 40% minimum.
1 · Frame the decision C1
Data science lifecycle = iterative question framing, acquisition, cleaning, analysis, modelling, communication and review. It is not a linear software project: iteration, evidence and decision use come before modelling.
Decision question = bounded question naming actor · outcome · evidence · action. A project failure mode prevents valid, usable or maintainable results.
| Ask first | Failure signal |
|---|---|
| Who acts, on what outcome? | Technically correct output has no usable decision. |
| What evidence is needed? | Wrong provenance, stakeholder or implementation path. |
| What would change the claim? | No boundary or counter-case can be stated. |
prediction erroreᵢ = yᵢ − ŷᵢ · observed minus predicted; sign shows over/under-prediction only after the target and scale are named.
1b · Reproducible synthesis C12 · course data
Reproducible analysis means data choices, code, outputs and interpretation can be rerun and inspected. A poster narrative orders question → data → method → result → evaluation → limitation.
2 · Values, types, contracts C2
Python value = a concrete object: number, string, Boolean or collection. Its data type fixes representation, valid operations and interpretation. Trace what reads, changes and depends on it.
function contracty = f(x) · specified typed input x → observable output y under documented type and boundary conditions.
| Test | What it exposes |
|---|---|
| Ordinary | Expected transformation on a representative valid value. |
| Boundary | Off-by-one, empty input, limit and transition behaviour. |
| Invalid | Type/domain failure: signal or recover; never silently corrupt. |
Automated test = reproducible comparison of behaviour/output with an expected result for specified input. State the expected result before execution. Change one condition at a time so a mismatch localises the defect.
2b · Trace, do not guess C2 · C3
| Step | Record |
|---|---|
| Before | value, type, collection state, control condition |
| Operation | branch taken, iteration item, call arguments |
| After | new state, return/output, invariant still true? |
Minimal example: expose one rule; explain why it works; name what breaks it; state failure behaviour. One success is not evidence for other types, missing values or boundaries.
Written-answer stem → “For input x of type …, the condition … selects …; the observable result is …; the boundary case changes this because …”.
2c · Contract failure grid C2
| Failure | Observable response |
|---|---|
| wrong type | reject or convert only under a documented rule |
| missing value | represent explicitly; do not let absence masquerade as data |
| empty collection | define return, identity value or deliberate failure |
| boundary value | test inclusion/exclusion at the exact transition |
| runtime error | handle without silently corrupting the result |
3 · Branch, iterate, parse C3
Conditional branch selects statements using a Boolean condition. Iteration repeats over a sequence or while a condition holds. Text parsing extracts structured information from character data using explicit rules.
loop accumulationsₖ = sₖ₋₁ + xₖ · define the initial value and invariant: after k items, what exactly does sₖ mean?
| Parser assumption | Boundary test |
|---|---|
| delimiter | missing, repeated or unexpected separator |
| case | upper/lower variants; normalise explicitly |
| encoding | character outside assumed representation |
| field presence | empty or missing field; do not shift columns silently |
Invariant test: choose an initial value that makes the claim true at k=0; show one update preserves it. A plausible final total cannot repair a wrong starting state.
4 · Choose the structure C4
List = ordered mutable collection accessed by position. Dictionary = mapping from unique keys to values for direct lookup/update. Aggregation = combine observations into grouped counts, totals, means or rates.
grouped meanx̄g = (1/ng) Σi∈g xᵢ · maintain both sum and count for each key; divide inside that group.
| Need | Use | Trap |
|---|---|---|
| sequence/position | list | looking up a group by repeated scanning |
| keyed lookup/update | dictionary | losing the grouping key |
| fair comparison | rate/mean | ranking totals when size/exposure differs |
5 · Cleaning as an audit C5
Data provenance records where data came from and how they were collected, transformed and used. A missing-value convention distinguishes absent, unknown, inapplicable or withheld values. A data-quality rule tests validity, consistency, completeness, uniqueness or timeliness.
missingness ratermiss = nmissing / nrows · numerator and denominator refer to the same in-scope field and records.
| Stage | Required evidence |
|---|---|
| Inspect | types, ranges, source, metadata, missing encodings |
| Transform | explicit rule; invalid conversions exposed |
| Account | row counts and summaries before/after each step |
| Validate | plausibility, type, uniqueness and completeness checks |
| Decide | exclude, impute or represent missingness; document why |
Boundary: the percentage quantifies recorded absence, not its cause. Clean-looking data need not be representative, correctly labelled or fit for the decision.
5b · Quality decisions C5
| If you see… | Do… |
|---|---|
| sentinel used as value | replace only when documentation establishes the convention |
| conversion failure | surface it; inspect affected records; never silently drop |
| duplicate key | test expected uniqueness before any join |
| missing target/feature | state the rule and downstream effect on the in-scope set |
10 · Annotation before modelling C10
Natural language processing represents, analyses or generates human-language data. Data annotation assigns labels or structured information. Inter-annotator agreement measures consistency among people using the same scheme.
observed agreementPo = nagreements / nitems
6 · Reusable data work C6
Python function = named reusable block with inputs, operations and optional return. Module = reusable file/library namespace. DataFrame = labelled two-dimensional table whose columns may have different types.
row-count invariantnout = nin − nremoved + nadded
Record counts before/after every filter and join. A filter should lose only rows failing its predicate. A join may duplicate keys: unexplained change → inspect key uniqueness and join type before continuing.
| Boundary | Question |
|---|---|
| function | one responsibility? typed input? returned result? |
| module | does reuse reduce duplication without hiding state? |
| CSV | delimiter, header, encoding, missing convention? |
| DataFrame | labels, column types, key uniqueness, in-scope rows? |
Limit: modularity improves testability but does not validate the semantics of a column, transformation or external source.
7 · Visual comparison C7
Visual encoding maps data to position, length, colour, shape or another channel. A comparison baseline is the reference value/group. Chart integrity means scale, selection and decoration do not misrepresent data or uncertainty.
normalised raterg = xg / ng · numerator and denominator must describe the same population and period.
Choose the chart after naming the comparison. Show denominator/rate unit and evidence boundary. Salience can amplify a biased comparison; polish never repairs poor data.
| Comparison need | Integrity check |
|---|---|
| group magnitude | same scale and in-scope population? |
8 · Similarity → recommendation C8
Clustering groups by defined similarity/distance. A distance metric quantifies feature-space dissimilarity. A recommendation ranks suggestions from user/item/similarity information and an objective.
Euclidean distanced(x,z) = √[Σⱼ₌₁ᵖ (xⱼ − zⱼ)²]
Path: define p features → justify/standardise scales → difference, square, sum, square-root → rank neighbours → test usefulness for the decision. A cluster is not a natural label; it is an output of representation, scaling, metric and algorithm choices.
9 · Predict and evaluate C9
Predictive model = fitted rule mapping features to an unknown outcome for new observations. Evaluation metric quantifies one aspect of performance. Generalisation is performance on relevant new data beyond training examples.
classification accuracyAccuracy = (TP + TN) / (TP + TN + FP + FN)
| Decision | Required check |
|---|---|
| split + metric | fit on training examples; evaluate held-out evidence with a decision-aligned metric |
| threshold + claim | inspect FP/FN, class balance, subgroup error and relevance to new data |
Training accuracy and one aggregate score can hide overfitting, subgroup error and an unusable threshold.
11 · AI reliability and fairness C11
Generative model produces from learned patterns/context. Algorithmic fairness examines group errors, benefits and burdens. Human oversight checks evidence and consequences before action.
selection-rate gapΔr = rA − rB · diagnostic signal, not a complete fairness judgement or remedy.