# Clustering, distances and interpretation

> Clustering groups examples according to a representation and similarity rule. The groups are not automatically true natural categories.

Course: [Machine learning methods and validation](https://studybrix.com/en/courses/machine-learning-methods/index.md)
Level: university
Prerequisites: Vectors and squared distances.

## Notes

### Unsupervised task

Clustering groups examples according to a representation and similarity rule. The groups are not automatically true natural categories.

### K-means

K-means alternates assignments to nearby centres with mean updates and seeks to reduce within-cluster squared distances.

### Scaling

Feature units can dominate distance. Standardization choices can change clusters and should be justified.

### Validation

Inspect stability, domain usefulness and sensitivity to settings. A visually separated plot is not by itself a universal quality certificate.

## Practice questions

### 1. Points 2 and 6 belong to one one-dimensional cluster. Find their mean centre.

Answer: 4

Explanation: (2+6)/2=4.

### 2. Find squared Euclidean distance between (1,2) and (4,6).

Answer: 25

Explanation: (4−1)²+(6−2)²=9+16.

### 3. What does k specify in basic k-means?

A. A learning rate for every algorithm
B. The number of clusters
C. The number of labels in every dataset
D. The guaranteed accuracy

Answer: The number of clusters

Explanation: k is the chosen number of centres/clusters.

### 4. Why can unit scaling change k-means results?

A. Distances depend on feature magnitudes
B. Units never affect distance
C. Every feature is automatically causal
D. Clusters ignore input coordinates

Answer: Distances depend on feature magnitudes

Explanation: Large-scale features can dominate squared distances.

### 5. For centre 3 and points 1 and 5, find total squared error.

Answer: 8

Explanation: (1−3)²+(5−3)²=4+4.

### 6. Why should a discovered cluster not immediately be given a sensitive personal label?

Sample answer / marking guidance: The grouping may reflect representation choices, bias or noise rather than a justified personal attribute. Interpretation requires evidence and ethical care.

Explanation: Credit uncertainty and harm-aware interpretation.

### 7. Explain why different initial centres may yield different k-means solutions.

Sample answer / marking guidance: The objective is nonconvex in the joint assignments and centres; iterative updates can reach different local solutions.

Explanation: Credit initialization and local optima.

### 8. Which is a reasonable robustness check?

A. Hide every alternative result
B. Repeat with different initializations and justified feature scales
C. Choose only the prettiest chart
D. Treat one run as ground truth

Answer: Repeat with different initializations and justified feature scales

Explanation: Sensitivity analysis reveals unstable groupings.

## Further reading

- https://developers.google.com/machine-learning/crash-course
- https://cs229.stanford.edu/

Original AI-assisted educational draft; not independently teacher-reviewed. References support further study, not copied exercises, affiliation or curriculum accreditation.
