StudyBrixFree worksheets, study guides and courses

Artificial intelligence · lesson 2 of 4

Clustering, distances and interpretation

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

University8 practice questionsNotes + worked examples

Learn the ideas

Prerequisites: Vectors and squared distances.

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.

Worked examples

Example 1

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

(2+6)/2=4.

4

Example 2

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

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

25

Check your understanding

8 questions

Decimals or fractions are accepted for numeric answers. Proofs and written responses use sample answers and require human marking. This is practice, not a protected examination.

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

Show answer and explanation

4

(2+6)/2=4.

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

Show answer and explanation

25

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

3 What does k specify in basic k-means?

Show answer and explanation

The number of clusters

k is the chosen number of centres/clusters.

4 Why can unit scaling change k-means results?

Show answer and explanation

Distances depend on feature magnitudes

Large-scale features can dominate squared distances.

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

Show answer and explanation

8

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

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

Sample answer and marking guidance

The grouping may reflect representation choices, bias or noise rather than a justified personal attribute. Interpretation requires evidence and ethical care.

Credit uncertainty and harm-aware interpretation.

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

Sample answer and marking guidance

The objective is nonconvex in the joint assignments and centres; iterative updates can reach different local solutions.

Credit initialization and local optima.

8 Which is a reasonable robustness check?

Show answer and explanation

Repeat with different initializations and justified feature scales

Sensitivity analysis reveals unstable groupings.

Further reading and review references

These are reference links, not copied exercises, institutional endorsement or proof of independent review.