about FIT5202
0 · Exam Mapcourse.json · brief
| Assignment 1 — Analysing Road Safety Data | 15% |
| Assignment 2 Part A — Building ML Models | 15% |
| Assignment 2 Part B — Streaming Application | 15% |
| Weekly Quizzes (Weeks 2–11) | 5% |
| Lab Attendance (Sessions 2–11) | 5% |
| Final Examination | 45% |
“Type: Closed Book” — FIT5202 Week 12 Recap 2026 slides, exam format (PDF_FIT5202_12_Recap_2026).
Final: e-assessment · 2h10m · scientific calculator · Weeks 1–12 · Q1 MCQ + Q2–Q6 written. Recite the rule, write the formula, show the path, interpret the output.
1 · Performance + PartitioningCh 1–2
same task, more processorsSpeed-up Sₚ = T₁/Tₚ · ideal linear Sₚ = p
Amdahl: Sₚ = 1 / [s + (1−s)/p]
bigger task + proportionally more resourcesScale-up = Tsmall / Tlarge · ideal = 1
| Method | Wins | Loses |
|---|---|---|
| Round-robin | even load | no locality; all nodes |
| Hash | exact match → 1 | range → all; skew |
| Range | ordered/range → selected | popular range skews |
Elapsed time is set by the slowest processor. Start-up, consolidation, interference, communication and skew make speed-up sub-linear. Zipf θ: 0 = no skew; 1 = highly skewed. Ordered partition → binary search; unordered → linear search.
Why parallel at all?
The five V’s are Volume (size), Variety (structured, semi-structured, unstructured), Velocity (batch to continuous streams), Veracity (trust) and Value (useful insight). FIT5202’s three themes are Volume (Weeks 1–4), Complexity/ML (Weeks 5–8) and Velocity/streaming (Weeks 9–11).
2 · Parallel JoinCh 3 · written
cost model — where it bites: choose planCtotal = CCPU + CI/O + Cnetwork
network/shuffle usually dominates
| Local join | Rule | Use |
|---|---|---|
| Nested loop | compare pairs | costly fallback |
| Sort-merge | sort both; merge | already sorted / large |
| Hash | build smaller; probe larger | equijoin workhorse |
Divide-and-broadcast: split R into Rᵢ; replicate all S to each processor; Rᵢ ⋈ S is complete because every R row meets every possible S match. Per processor, an evenly split S sends and receives |Sᵢ|(N−1) records. If both sides are large, hash-partition both on the same join key instead.
Say it “I choose ___ because it minimises network traffic; then each processor performs ___ locally.” Named outer-join methods: ROJA, DOJA, DER; OJSO targets skew.
3 · External SortCh 4
pass counter — calculationN₀ = ⌈F/B⌉ sorted runs
Nⱼ₊₁ = ⌈Nⱼ/(B−1)⌉ until 1
Total passes = 1 sort pass + merge passes
| Parallel sort | Bottleneck / move |
|---|---|
| Merge-all | one final K-way merge bottleneck |
| Binary-merge | pairwise pipelined merge |
| Redistribution variants | spread merge load; shuffle |
| Partitioned | range-redistribute → local sort; no merge; skew risk |
Reserve one output buffer: fan-in is B−1, never B. Parallel partitioned sort: round-robin load for balance → range redistribute → independent local sort.
Five forms: merge-all; binary-merge; redistribution binary-merge; redistribution merge-all; partitioned sort. Redistribution spreads merge work but shuffles. Partitioned sort needs no final merge because ranges establish global order; bad boundaries create skew.
4 · Group-ByCh 4 · method choice
| Method | Flow | Decision |
|---|---|---|
| Traditional | local → coordinator | single-node finish |
| Two-phase | local partial → shuffle partials → final | best when local reduction is large |
| Redistribution | shuffle raw → local aggregate | few groups / little reduction |
AVG trap: never average partial averages. Carry (sum,count); final AVG = Σsum/Σcount. The same network-cost logic used for joins decides which group-by wins.
5 · Featurisation PipelineCh 5
| Job | Tools / output |
|---|---|
| Extract text | CountVectorizer counts; TF-IDF weights; Word2Vec vectors; FeatureHasher |
| Transform | Tokenizer, stop-word removal, StringIndexer, OneHotEncoder |
| Assemble | VectorAssembler → one features vector |
tf-idf — feature weightingIDF(t,D)=ln[(|D|+1)/(DF(t,D)+1)]
TFIDF = TF × IDF
StringIndexer orders labels by frequency; One-Hot removes the false numerical order. Spark uses an N−1-dimensional vector for N categories. Train/test roles stay distinct: fit on training data; evaluate on held-out data.
Task gate: supervised data have labels—classification predicts a discrete label; regression a continuous value. Unsupervised data have none—clustering finds groups; association finds co-occurrence. Featurisation is Extraction + Transformation + Selection; the pipeline preserves the same order for training and later records.
6 · Decision TreesCh 6 · core calc
id3 — split scoringH(S)=Σ pᵢ log₁₀(1/pᵢ)
H(S,A)=Σ(|Sⱼ|/|S|)H(Sⱼ)
IG(S,A)=H(S)−H(S,A) → choose largest
- Compute parent entropy.
- For every attribute: child entropies → weighted entropy → information gain.
- Split on maximum gain; recurse until pure or stopped.
Depth judgement: too deep memorises noise (overfit); too shallow underfits. Limit maxDepth or prune. Random forest = bootstrap trees + feature subsets + majority vote; reduces one tree’s variance. Data parallelism partitions records; result parallelism grows tree nodes across processors.
7 · Classifier EvaluationCh 6
| Pred + | Pred − | |
|---|---|---|
| Actual + | TP | FN |
| Actual − | FP | TN |
Accuracy=(TP+TN)/all
Precision=TP/(TP+FP) — false alarms
Recall=TP/(TP+FN) — misses
F1=2PR/(P+R)
Fix the positive class first. On imbalanced data, accuracy can look excellent while the rare positive class is missed. Report precision, recall and F1, then state the FP/FN trade-off.
8 · k-MeansCh 7 · trace
d(a,b)=√Σ(aᵢ−bᵢ)² · 1-D: |a−b|
centroid = Σ cluster points / count
9 · Collaborative FilteringCh 8
user similarity — co-rated items onlysim(u,u′)=Σ rᵤᵢrᵤ′ᵢ / [√Σrᵤᵢ² √Σrᵤ′ᵢ²]
predict unseen ratingr̂ᵤᵢ = k Σ sim(u,u′)rᵤ′ᵢ
k = 1/Σ|sim(u,u′)|
- Restrict each user pair to co-rated items.
- Compute similarities.
- Use only neighbours who rated the target item; weight and normalise.
- Rank predicted unseen ratings for top-N.
| Choice | Meaning / scaling |
|---|---|
| User-based | similar users → borrow item ratings |
| Item-based | similar item columns → recommend |
| Matrix factorisation | R(N×M) ≈ U(N×r)V(r×M) |
| ALS | fix U solve V; fix V solve U; minimise squared error/RMSE |
Sanity check: prediction must stay in the rating scale. Forgetting k can push it outside. New user/item → too few ratings: cold start.
10 · Method ChooserComplexity
| labelled + discrete target | classification |
| labelled + continuous target | regression |
| unlabelled groups | clustering |
| sparse user–item preferences | CF / ALS |
Written move Name the task, define inputs/output, state the selection metric, show the update, give the stop/evaluation rule.
ALS + cold-start recall
model objectivemin Σ(rᵤᵢ − uᵤ·vᵢ)² over observed ratings
R is N users × M items; U is N×r and V is r×M, with r latent features. ALS makes the joint problem manageable by fixing U while solving V, then fixing V while solving U, alternating to reduce error. A predicted cell is the user-profile/item-profile dot product. Memory-based CF re-scans neighbours; factorisation learns compact profiles for scale.
11 · Kafka + WindowsCh 9
| Term | Recall line |
|---|---|
| Topic | named feed |
| Partition | parallel append-only log |
| Offset | unique increasing ID within partition |
| Broker | server storing/replicating partitions |
| Consumer | tracks its own position; reads do not delete |
Event time = produced at source; processing time = reaches processor. Delay/bursts separate them. Spark Structured Streaming follows producer → processor → consumer.
12 · Stream Join + ReductionCh 10–11
shj arrival ruleexpire old → probe OTHER table → emit → insert OWN
Two tables preserve partners arriving in either order. A window or watermark bounds otherwise unbounded state; older event-time state can be discarded. M-Join: expire, probe all other tables, then hash into own.
| slide s vs window w | class |
|---|---|
| s = 1 record | overlap, no reduction; moving average |
| 1 < s < w | overlap, with reduction |
| s = w | tumbling, with reduction |
Sensor arrays: same thing → Reduce over time then Merge sensors, or reverse. Different things require Normalize around the merge. Sampling and load shedding trade detail/accuracy for throughput.
State logic: stream–static buffers the streaming side; stream–stream retains both because either partner may arrive later. Window expiry bounds the two tables; a watermark advances an event-time threshold while tolerating some lateness.