Skip to main content

Cluster analysis applications; K-means

Short answer

Cluster analysis is used in marketing segmentation, biology, image processing, fraud detection, etc. K-means iteratively assigns points to the nearest centroid (Euclidean distance) and recomputes means until stable. Example with points (2,2)… yields Cluster 1 = {1,2,5} centroid (2.67,2.33); Cluster 2 = {3,4} centroid (8.5,7.5).

Explain the application areas of Cluster Analysis. Describe K-means clustering algorithm with example.

Application areas of cluster analysis

  • Marketing: customer segmentation by buying behaviour for targeted campaigns.
  • Biology/medicine: grouping genes and proteins with similar function, taxonomy of plants and animals, disease subtypes.
  • Image processing: image segmentation, colour quantisation, pattern recognition.
  • Information retrieval/web: grouping documents, news and search results; recommender systems.
  • Urban planning and earth science: grouping houses by type/value, earthquake zones, land-use mapping.
  • Fraud and intrusion detection: objects that fit no cluster are outliers.
  • Insurance, finance, social networks (community detection) and as a data compression and preprocessing step.

K-means algorithm

1. Choose k and select k initial centroids (random objects).
2. Repeat
   a. Assign each object to the nearest centroid
      (Euclidean distance) -> k clusters.
   b. Recompute each centroid as the mean of its cluster.
3. Until no object changes cluster (centroids stable).

The objective is to minimise SSE = Σᵢ Σ_{x∈Cᵢ} ‖x − cᵢ‖².

Example (k = 2)

Points: 1 (2, 2), 2 (3, 2), 3 (8, 7), 4 (9, 8), 5 (3, 3). Initial centroids: C1 = point 1 (2, 2), C2 = point 3 (8, 7).

Iteration 1

Pointd to C1d to C2Cluster
1 (2, 2)0.007.81C1
2 (3, 2)1.007.07C1
3 (8, 7)7.810.00C2
4 (9, 8)9.221.41C2
5 (3, 3)1.416.40C1

New centroids: C1 = ((2 + 3 + 3)/3, (2 + 2 + 3)/3) = (2.67, 2.33); C2 = ((8 + 9)/2, (7 + 8)/2) = (8.5, 7.5).

Iteration 2: every point is nearest to the same centroid as before (e.g. point 5: 0.75 vs 7.1), so there is no change and the algorithm stops.

Result: Cluster 1 = {1, 2, 5} with centroid (2.67, 2.33) and Cluster 2 = {3, 4} with centroid (8.5, 7.5).

✓ Answer checked by Claude Opus 5.5 (high effort)

All Data Mining chapter 5 questions →