Machine Learning
105602Module 5: Clustering
1(h). K-medoids differs from K-means because K-medoids uses (i) An actual data point as the cluster representative (ii) The mean of all clusters (iii) A randomly generated point (iv) Eigenvectors20262m
Module 5: Clustering
View this question on its own page →K-medoids differs from K-means because K-medoids uses (i) An actual data point as the cluster representative (ii) The mean of all clusters (iii) A randomly generated point (iv) Eigenvectors
Worked SolutionAnswer: (i) An actual data point as the cluster representative
K-medoids selects an observed data point (a medoid) as each cluster's representative. K-means uses the arithmetic mean, which need not be an actual data point.
1(i). A dataset contains two elongated, non-spherical clusters. Which method is generally more appropriate than standard K-means? (i) K-means (ii) Linear regression (iii) Density-based clustering (iv) Naive Bayes20262m
Module 5: Clustering
View this question on its own page →A dataset contains two elongated, non-spherical clusters. Which method is generally more appropriate than standard K-means? (i) K-means (ii) Linear regression (iii) Density-based clustering (iv) Naive Bayes
Worked SolutionAnswer: (iii) Density-based clustering
Density-based methods such as DBSCAN can discover irregularly shaped clusters and label sparse points as noise. K-means works best for compact, roughly spherical clusters under Euclidean distance.
6(b). Given the 2D points A(1,1), B(1,2), C(2,1), D(2,2), E(8,8), F(8,9), G(9,8), H(15,15), use DBSCAN with ε = 1.5 and MinPts = 3 to identify core, border and noise points and determine the clusters.20267m
Module 5: Clustering
View this question on its own page →Given the 2D points A(1,1), B(1,2), C(2,1), D(2,2), E(8,8), F(8,9), G(9,8), H(15,15), use DBSCAN with ε = 1.5 and MinPts = 3 to identify core, border and noise points and determine the clusters.
Worked SolutionDBSCAN with ε = 1.5 and MinPts = 3
Assume MinPts includes the point itself. A point is core if its ε-neighborhood contains at least 3 points. Points A–D are mutually within distance (\sqrt2\approx1.414), so each has at least 4 points in its neighborhood. E, F and G are also mutually within ε (their pairwise distances are 1 or (\sqrt2)), so each has 3 points including itself. H is far from every other point.
- Cluster 1: {A, B, C, D} — all core points.
- Cluster 2: {E, F, G} — all core points.
- Noise: H.
- Border points: none.
MermaidDiagramRendering diagram…8(a). Explain the complete K-means algorithm. Discuss its objective function, convergence criterion, and major limitations.20267m
Module 5: Clustering
View this question on its own page →Explain the complete K-means algorithm. Discuss its objective function, convergence criterion, and major limitations.
Worked SolutionK-means clustering
K-means partitions data into (K) clusters by minimizing within-cluster squared distance:
Algorithm: (1) choose (K) initial centroids; (2) assign each point to the nearest centroid; (3) recompute each centroid as the mean of assigned points; (4) repeat assignment and update until assignments/centroids stop changing or a maximum iteration count is reached.
MermaidDiagramRendering diagram…Each iteration does not increase the objective, so the algorithm converges to a local optimum. Limitations: must choose K, sensitive to initialization and outliers, favors roughly spherical similarly scaled clusters, and requires numeric distance-compatible features.
8(b). Explain hierarchical clustering. Differentiate between agglomerative and divisive approaches and explain how a dendrogram is constructed.20267m
Module 5: Clustering
View this question on its own page →Explain hierarchical clustering. Differentiate between agglomerative and divisive approaches and explain how a dendrogram is constructed.
Worked SolutionHierarchical clustering
Hierarchical clustering builds a nested sequence of clusters and represents it using a dendrogram.
- Agglomerative (bottom-up): begin with each point as its own cluster; repeatedly merge the closest clusters using a linkage rule (single, complete, average or Ward).
- Divisive (top-down): begin with all points in one cluster and recursively split them.
The dendrogram's leaves represent observations; branch heights represent merge/split dissimilarity. Cutting the dendrogram at a chosen height produces a flat clustering. Hierarchical clustering need not require K in advance, but naive implementations can be computationally expensive and early merges/splits are generally irreversible.
Q3(b). Differentiate between unsupervised and descriptive learning.20237m
Module 5: Clustering
View this question on its own page →Differentiate between unsupervised and descriptive learning.
Q8(a). Explain the principle of unsupervised and descriptive learning with respect to clustering.20237m
Module 5: Clustering
View this question on its own page →Explain the principle of unsupervised and descriptive learning with respect to clustering.