11.7b ML clustering labs
Source: Lab ideas from Computational Physics (Landau, Páez, Bordeianu), §11.6. Original -means / schedule drills on a fixed mass list — not sklearn/Pandas dumps. Continues 11.7.
Explorer
Pure Python. No NumPy / sklearn / Pandas.
Fixed masses (MeV/):
0.0, 0.511, 105.65, 105.658, 134.98, 139.57, 139.57,
547.862, 497.611, 493.677, 938.272, 939.565,
1115.683, 1180.37, 1197.449, 1314.86, 1321.71, 1672.45
Formula refresh
Warm up: pick the matching equation among lookalikes (same walk as the theory lesson).
Labs
Activity: Nearest of
For mass , print the index , , or of the nearest init centroid (ties → smaller index).
No input.
Write-ups
Using “kmeans”, “centroid”, and “assign”, explain:
State the two alternating steps of Lloyd k-means.
Minimum 3 words. Your answer must include: “kmeans”, “centroid”, “assign”.
0 words
Meet the writing requirements, then you can open the model answer.
Next: 11.8 Keras deep-learning API.