Data Warehousing and Data Mining · Unit 5
Clustering Methods
Exam-focused notes for Clustering Methods (Data Warehousing and Data Mining, BIT454): what the TU syllabus asks and how it has actually been tested, with 5 solved past questions from this unit.
Clustering Methods in short
Clustering groups similar objects together without using class labels. It is used for customer segments, image grouping, and for finding patterns in unknown data.
What this unit covers
- Clustering approaches and types
- K-means algorithm and limitations
- Agglomerative clustering approach
- Divisive clustering approach
- Types of data in clustering
- High dimensional data clustering
- Similarity measures for ordinal data
K-means algorithm and limitations
2081 · 10 marks
List different clustering approaches. Write the algorithm of K-means algorithm. What are its limitations?[10]
Show solved answerHide answer
Model Answer: Clustering Approaches and K-Means Algorithm
Different Clustering Approaches (3 marks)
Clustering approaches can be classified into the following main categories:
-
Partitioning Methods
- Divide data into k non-overlapping clusters
- Examples: K-means, K-medoids, PAM (Partitioning Around Medoids)
-
Hierarchical Methods
- Build a hierarchy of clusters (dendrogram)
- Agglomerative (bottom-up): Start with individual points, merge into clusters
- Divisive (top-down): Start with one cluster, split into smaller clusters
-
Density-Based Methods
- Cluster based on density of data points
- Examples: DBSCAN, OPTICS
- Can find arbitrary-shaped clusters
-
Grid-Based Methods
- Divide data space into grid cells
- Cluster based on grid structure
- Example: STING
-
Model-Based Methods
- Assume data generated from probability distribution
- Example: Gaussian Mixture Models (GMM)
K-Means Algorithm (5 marks)
Algorithm Steps:
Input: Dataset D with n objects, number of clusters k
Output: k clusters with minimum within-cluster variance
Steps:
-
Initialize: Randomly select k initial cluster centers (centroids) from the dataset or randomly in the data space.
-
Assignment Step: Assign each data point to the nearest centroid using Euclidean distance:
For each point x_i in D: d = minimum distance to any centroid Assign x_i to cluster C_j where centroid is nearest -
Update Step: Recalculate centroids as the mean of all points in each cluster:
For each cluster C_j: centroid_j = (1/|C_j|) * Σ(x_i) for all x_i in C_j -
Convergence Check: If centroids have not changed (or change is below threshold), stop. Otherwise, go to Step 2.
-
Output: Final k clusters and their centroids.
Pseudocode:
Algorithm K-Means(D, k)
C = randomly select k centroids from D
repeat
for each point x in D do
assign x to nearest centroid
end for
for each cluster j do
update centroid_j = mean of all points in cluster j
end for
until centroids do not change
return clusters
Limitations of K-Means (2 marks)
-
Sensitive to Initial Centroids: Different initial selections may lead to different final clusters. Algorithm may converge to local optima rather than global optimum.
-
Fixed Number of Clusters: Must specify k in advance. No automatic method to determine optimal k.
-
Assumes Spherical Clusters: Works best with roughly spherical, similarly-sized clusters. Fails with elongated or irregular cluster shapes.
-
Sensitive to Outliers: Outliers can significantly affect centroid calculation and cluster quality.
-
Computational Cost: For large datasets with many dimensions, distance calculations become expensive.
-
Equal Cluster Size Assumption: Tends to produce clusters of roughly equal size, which may not reflect actual data distribution.
-
Convergence Issues: May converge slowly or get stuck in local minima.
-
Not Suitable for Categorical Data: K-means uses Euclidean distance, designed for numerical data only.
Similarity measures for ordinal data
2082.1 · 5 marks
How do you find similarities between ordinal data attributes? Explain. [5]
Types of data in clustering
High dimensional data clustering
2082.1 · 5 marks
What is outlier? How do you cluster high dimensional data? [2+3]
Agglomerative clustering approach
2082.1 · 5 marks
Differentiate between agglomerative and divisive clustering approach. [5]
Make Unit 5 stick
Practice BIT454 with flashcards & quizzes