---
title: "Cluster analysis applications; K-means"
subject: "Data Mining"
chapter: 5
key: "semester_7/data_mining:cluster-application-kmeans"
source: https://www.bctengineer.com/q/semester_7/data_mining/cluster-application-kmeans
site: BCT Engineering
---

# Cluster analysis applications; K-means

Data Mining · Chapter 5: Cluster Analysis

- Asked in: year not given, 3+7 marks
- Video: [K Means Clustering Algorithm | K Means Solved Numerical Example Euclidean Distance by Mahesh Huddar](https://www.youtube.com/watch?v=KzJORp8bgqs) — Mahesh Huddar
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_7/data_mining/cluster-application-kmeans
- Whole chapter: https://www.bctengineer.com/md/semester_7/data_mining/chapter-5

## Question

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

## 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).

## Answer

#### 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
```text
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**
| Point | d to C1 | d to C2 | Cluster |
| --- | --- | --- | --- |
| 1 (2, 2) | 0.00 | 7.81 | C1 |
| 2 (3, 2) | 1.00 | 7.07 | C1 |
| 3 (8, 7) | 7.81 | 0.00 | C2 |
| 4 (9, 8) | 9.22 | 1.41 | C2 |
| 5 (3, 3) | 1.41 | 6.40 | C1 |

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).

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. How does clustering help in fraud or intrusion detection?
   A. Objects that fit no cluster are treated as outliers
   B. Every object in the biggest cluster is flagged as fraud
   C. It labels each record using given class labels
   D. It deletes all small clusters before analysis
   Answer: A. Objects that do not belong to any cluster are outliers, which may indicate fraud or intrusion. (Key point: Outlier detection use)

2. What are the two repeated steps of K-means?
   A. Split the biggest cluster and merge the smallest
   B. Assign each object to the nearest centroid, then recompute centroids as cluster means
   C. Compute medoids and swap them with random objects
   D. Find core points and expand clusters
   Answer: B. K-means alternates assignment to the nearest centroid and recomputing the mean of each cluster until stable. (Key point: K-means loop)

3. When does K-means stop?
   A. After exactly k iterations
   B. When all clusters have equal size
   C. When no object changes cluster (centroids are stable)
   D. When SSE reaches exactly zero
   Answer: C. The loop ends when assignments no longer change, so the centroids stay the same. (Key point: Stopping criterion)

4. In the example, points 1 (2,2), 2 (3,2), 5 (3,3) form one cluster. What is its centroid?
   A. (3, 3)
   B. (2.67, 2.33)
   C. (8.5, 7.5)
   D. (2, 2)
   Answer: B. Mean X = (2+3+3)/3 = 2.67 and mean Y = (2+2+3)/3 = 2.33. (Key point: Worked example)

## Related in Data Mining

- [Cluster analysis; K-means on height/width](https://www.bctengineer.com/question.md?key=semester_7%2Fdata_mining%3Akmeans-height-width) — Data Mining, chapter 5
- [Need of clustering; hierarchical vs partitioning; K-means](https://www.bctengineer.com/question.md?key=semester_7%2Fdata_mining%3Acluster-need-hier-vs-partition-kmeans) — Data Mining, chapter 5
- [Short note: K-means clustering](https://www.bctengineer.com/question.md?key=semester_7%2Fdata_mining%3Akmeans-note) — Data Mining, chapter 5
- [K-means on six 2-D instances (K=2)](https://www.bctengineer.com/question.md?key=semester_7%2Fdata_mining%3Akmeans-x-y-k2) — Data Mining, chapter 5
- [K-means on 1-D data, K=2 and K=3](https://www.bctengineer.com/question.md?key=semester_7%2Fdata_mining%3Akmeans-1d-k2-k3) — Data Mining, chapter 5
- [Clustering, need and qualities](https://www.bctengineer.com/question.md?key=semester_7%2Fdata_mining%3Aclustering-define-qualities) — Data Mining, chapter 5

## Related in other subjects

- [Lumped vs distributed analysis, applications, protocols](https://www.bctengineer.com/question.md?key=semester_7%2Frf_and_microwave_engineering%3Alumped-distributed-protocols) — RF and Microwave Engineering, chapter 1
