Skip to main content

11.7b ML clustering labs

Source: Lab ideas from Computational Physics (Landau, Páez, Bordeianu), §11.6. Original kk-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/c2c^2):

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 {100,600,1200}\{100,600,1200\}

For mass 0.5110.511, print the index 00, 11, or 22 of the nearest init centroid (ties → smaller index).

No input.

Write-ups​

0/3 solved
11.7b.W1

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/ 3 min

Meet the writing requirements, then you can open the model answer.

Next: 11.8 Keras deep-learning API.