Group without labels
Ask groups to propose clusters from the same points and compare boundaries.
Ask: “What makes one grouping better under a stated rule?”
Listen for: “We need an objective, such as distance to a centre.”
Brightlab
Year 9 · Unsupervised learning
Do clusters discover categories, or help us invent them?
Go to the investigation ↓A clustering field report with centroid calculations and sensitivity comparisons.
Take this investigation into Python: open the interactive Marimo notebook →
How much do the groups depend on your choices?
K-means assigns each point to the closest centroid, then moves each centroid to the mean of its assigned points. Repeating these steps reduces or preserves the within-cluster squared-distance objective. Initial centroids and feature scales affect the result. Clusters are useful summaries under a chosen geometry, not proof of natural kinds or social categories.
Before this lesson: Compute or compare distances between points. Useful earlier investigations: A map of almost-right books.
K-means assigns each point to the closest centroid, then moves each centroid to the mean of its assigned points. Repeating these steps reduces or preserves the within-cluster squared-distance objective. Initial centroids and feature scales affect the result. Clusters are useful summaries under a chosen geometry, not proof of natural kinds or social categories.
Compute or compare distances between points. Useful earlier investigations: A map of almost-right books.
Print the synthetic reef points and two initial centroids. Review coordinate means. Explain empty-cluster handling: keep its previous centroid rather than divide by zero.
ACARA V9 AI curriculum connection ↗ · Technologies ↗
A complete teaching sequence · 80 minutes
Ask groups to propose clusters from the same points and compare boundaries.
Ask: “What makes one grouping better under a stated rule?”
Listen for: “We need an objective, such as distance to a centre.”
Predict the closest centroid for a marked point before assigning.
Ask: “Which distance contributions matter?”
Listen for: “Both axes after applying their scales.”
Run assignment and centroid update separately. Inspect movement, membership and inertia. Calculate one centroid by hand.
Ask: “Why must the centre move to the mean of its members?”
Listen for: “That minimises squared distances for the fixed assignment.”
Change only the feature scale and rerun from the same centres.
Ask: “Did the underlying observations change?”
Listen for: “No, their relative importance in distance changed.”
Compare two initialisations and one scale choice. Choose a grouping for an explicit synthetic survey purpose and document instability.
Ask: “Does the lowest inertia establish biological truth?”
Listen for: “No, it optimises the chosen representation.”
Submit point assignments, centroids and a scale-sensitivity note.
Ask: “How should an empty cluster be handled?”
Listen for: “Explicitly, without treating an undefined mean as valid.”
Clusters reveal natural categories.
Rescaling one unchanged feature can reorganise the clusters; a different initialisation can reach a different local solution.
Choose a justified scale and initialisation, compare alternatives and state what the grouping cannot establish.
Ask learners to recompute a centroid and explain one reassigned point. Reject naming clusters as discovered species without external evidence.
| Criterion | Beginning | Secure | Extending |
|---|---|---|---|
| Algorithm trace | Treats clusters as a visual guess | Explains assignment and mean update | Handles ties or empty clusters explicitly |
| Interpretation | Treats grouping as ground truth | Tests scale sensitivity | Justifies a use while documenting unstable assignments |
Use six points and two clusters; allow precomputed distance tables before working directly with the map.
Create a non-convex dataset and explain why k-means geometry can produce a poor semantic grouping even with low inertia.
Only synthetic reef measurements are grouped. Do not cluster students or infer identity categories from behavioural data.
Shared device? Turn remembering off. A project file lets you continue on another device.
Your browser is the laboratory
Predict the marked point’s nearest centroid before assignment, then predict the effect of stretching the horizontal feature.
Twenty-four unlabelled synthetic points span two measurement axes. Probe 1 is at (1,1.5). Initial centroids are (2,2) and (8,8). Alternate nearest-centroid assignments and moves to member means. Horizontal distance weight starts at 1.
The experiment opens after your prediction.
There is no penalty for being surprised.
Apple Silicon · PyTorch MPS
Run fifteen k-means iterations on a large seeded unlabelled cloud. Change horizontal feature weight and compare convergence, inertia and cluster sizes on MPS/CUDA.
Students extend the experiment in teams, documenting parameters, outputs and limitations.
The bundle contains lesson-specific working code, a configuration file, a reactive notebook, a deterministic CPU check and hardware setup instructions. Acceleration is reported only after a tensor operation and result read-back succeed.
Download Mac Studio investigation ↓unzip y9-clusters-mac-pathway.zip -d y9-clusters-mac cd y9-clusters-mac bash setup-mac.sh source .venv/bin/activate python experiment.py --device mps --output results marimo edit notebook.py
CPU and available-device execution status is recorded in the downloaded README and validation report. DGX Spark execution requires that hardware; static validation alone does not establish GPU compatibility or performance. The browser lesson remains fully available without this extension.
NVIDIA DGX Spark · PyTorch CUDA
Run fifteen k-means iterations on a large seeded unlabelled cloud. Change horizontal feature weight and compare convergence, inertia and cluster sizes on MPS/CUDA.
Students extend the experiment in teams, documenting parameters, outputs and limitations.
The bundle contains lesson-specific working code, a configuration file, a reactive notebook, a deterministic CPU check and hardware setup instructions. Acceleration is reported only after a tensor operation and result read-back succeed.
Download DGX Spark investigation ↓unzip y9-clusters-dgx-pathway.zip -d y9-clusters-dgx cd y9-clusters-dgx bash run-dgx.sh # Open the localhost notebook URL printed by the container.
CPU and available-device execution status is recorded in the downloaded README and validation report. DGX Spark execution requires that hardware; static validation alone does not establish GPU compatibility or performance. The browser lesson remains fully available without this extension.
A clustering field report with centroid calculations and sensitivity comparisons.
Download the editable handout →