Module Material: 06. Cluster Analysis (Unsupervised)

Source presentation: DA08 - Clustering.pdf

Lecture 06: Cluster Analysis (Unsupervised Learning)

Source Material: materials/DA08 - Clustering.pdf / materials/DA08 - Clustering.md
Course: Introduction to Data Analytics (CE KMITL)
Topics: Unsupervised Clustering, Distance Metrics, K-Means Algorithm, Sum of Squared Errors (SSE), DBSCAN, Cluster Validation, Dimensionality Reduction (PCA/SVD)


1. Overview of Cluster Analysis

1.1 What is Clustering?

Cluster Analysis (Clustering) is an unsupervised learning technique that partitions an unlabelled dataset into natural subgroups (clusters). Unlike supervised learning (regression and classification), clustering algorithms do not receive target output labels (yy). Instead, the objective is discovered purely from patterns, relationships, and geometric structures in the feature space.

  • Intra-cluster similarity: Data objects assigned to the same cluster should be as close or similar to one another as possible (minimized intra-cluster distance).
  • Inter-cluster dissimilarity: Data objects belonging to different clusters should be as distinct and separated as possible (maximized inter-cluster distance).
flowchart LR subgraph Supervised["Supervised Learning"] S_Data["Input Data X + Labels y"] --> S_Model["Predictive Model"] S_Model --> S_Out["Classification / Regression Output"] end subgraph Unsupervised["Unsupervised Learning"] U_Data["Input Data X (No Labels)"] --> U_Model["Clustering / Reduction"] U_Model --> U_Out["Discovered Groups / Latent Structures"] end

1.2 Ambiguity in Cluster Boundaries

The true number of clusters in a dataset is often inherently ambiguous. For example, depending on the scale of observation or business context:

  • Viewing data globally may suggest 2 clusters.
  • Viewing intermediate sub-structures may suggest 4 clusters.
  • Viewing fine-grained local density peaks may suggest 6 clusters.

This ambiguity necessitates formal mathematical distance metrics and objective validation criteria.

1.3 Taxonomy of Clustering Approaches

Clusterings and clustering algorithms can be categorized across several key dimensions:

Dimension Category Core Characteristics
Hierarchical vs. Partitional Partitional Clustering Divides data into non-overlapping subsets such that each data point belongs to exactly one cluster (e.g., K-Means).
Hierarchical Clustering Constructs a nested tree of clusters (dendrogram) from single points up to a single root cluster (Agglomerative or Divisive).
Cluster Shape / Model Center-Based An object belongs to the cluster whose center (centroid or medoid) is closest (e.g., K-Means, K-Medoids / PAM).
Density-Based A cluster is a dense region of points separated from other clusters by regions of low density (e.g., DBSCAN).
Exclusivity Exclusive (Hard) Each point belongs strictly to one cluster.
Non-Exclusive (Overlapping) Points can belong simultaneously to multiple clusters (e.g., border points or multi-topic documents).
Fuzziness Non-Fuzzy (Crisp) Binary membership: point ii is either in cluster jj (wij=1w_{ij} = 1) or not (wij=0w_{ij} = 0).
Fuzzy (Soft) Probabilistic membership: weights wij∈[0,1]w_{ij} \in [0, 1] sum to 1 (∑jwij=1\sum_j w_{ij} = 1), as in Fuzzy C-Means.
Completeness Complete Every data point in the dataset is assigned to a cluster.
Partial Some points may be left unassigned as background noise or outliers (e.g., DBSCAN).

2. Distance and Proximity Metrics

Clustering algorithms rely on proximity measures to quantify similarity or dissimilarity between data points x=(x1,x2,…,xd)\mathbf{x} = (x_1, x_2, \dots, x_d) and y=(y1,y2,…,yd)\mathbf{y} = (y_1, y_2, \dots, y_d) in a dd-dimensional feature space.

2.1 Euclidean Distance (L2L_2 Norm)

The standard straight-line geometric distance between two points:

dEuclidean(x,y)=∥x−y∥2=∑i=1d(xi−yi)2d_{\text{Euclidean}}(\mathbf{x}, \mathbf{y}) = \|\mathbf{x} - \mathbf{y}\|_2 = \sqrt{\sum_{i=1}^d (x_i - y_i)^2}

2.2 Manhattan Distance (L1L_1 Norm / City Block)

The grid-based rectilinear distance:

dManhattan(x,y)=∥x−y∥1=∑i=1d∣xi−yi∣d_{\text{Manhattan}}(\mathbf{x}, \mathbf{y}) = \|\mathbf{x} - \mathbf{y}\|_1 = \sum_{i=1}^d |x_i - y_i|

2.3 General Minkowski Distance (LpL_p Norm)

A generalized metric family parameterized by p≥1p \ge 1:

dMinkowski(x,y)=∥x−y∥p=(∑i=1d∣xi−yi∣p)1/pd_{\text{Minkowski}}(\mathbf{x}, \mathbf{y}) = \|\mathbf{x} - \mathbf{y}\|_p = \left( \sum_{i=1}^d |x_i - y_i|^p \right)^{1/p}

When p=1p = 1, it becomes Manhattan distance; when p=2p = 2, it becomes Euclidean distance; when p→∞p \to \infty, it becomes Chebyshev distance (max⁡i∣xi−yi∣\max_i |x_i - y_i|).

Pre-processing Prerequisite: Because distance formulas sum squared or absolute feature differences, variables with larger raw magnitudes dominate the distance calculations. Continuous features must be normalized (via Min-Max scaling or Z-score standardization) prior to clustering.


3. K-Means Clustering Algorithm

3.1 Algorithm Overview

K-Means (commonly implemented via Lloyd’s Algorithm) is an iterative, partitional, center-based clustering algorithm. Given an unlabelled dataset X={x1,…,xn}X = \{\mathbf{x}_1, \dots, \mathbf{x}_n\} and a pre-specified number of clusters KK, the algorithm partitions XX into KK disjoint clusters {C1,C2,…,CK}\{C_1, C_2, \dots, C_K\}.

flowchart TD Start(["Start: Dataset X and number of clusters K"]) --> Init["1. Initialize K Centroids randomly or via K-Means++"] Init --> Assign["2. Assignment Step:\nAssign each point to the nearest centroid"] Assign --> Recompute["3. Update Step:\nRecompute each centroid as the mean of its assigned points"] Recompute --> Check{"4. Convergence Check:\nHave centroids or memberships changed?"} Check -->|Yes, centroids moved| Assign Check -->|No, centroids converged| Done(["End: Optimal Cluster Assignments"])

3.2 Objective Cost Function: Sum of Squared Errors (SSE)

The mathematical objective of K-Means is to find cluster assignments and centroids that minimize the Sum of Squared Errors (SSE):

SSE=∑i=1K∑x∈Cidist(x,ci)2=∑i=1K∑x∈Ci∥x−ci∥22\text{SSE} = \sum_{i=1}^K \sum_{\mathbf{x} \in C_i} \text{dist}(\mathbf{x}, \mathbf{c}_i)^2 = \sum_{i=1}^K \sum_{\mathbf{x} \in C_i} \|\mathbf{x} - \mathbf{c}_i\|_2^2

where:

  • KK is the number of clusters.
  • CiC_i is the set of data points belonging to cluster ii.
  • ci\mathbf{c}_i is the centroid (mean vector) of cluster CiC_i:

ci=1∣Ci∣∑x∈Cix\mathbf{c}_i = \frac{1}{|C_i|} \sum_{\mathbf{x} \in C_i} \mathbf{x}

The recomputation of ci\mathbf{c}_i as the arithmetic mean mathematically guarantees the minimization of SSE for Euclidean distance.


3.3 Step-by-Step 1D Worked Example

Consider a 1-dimensional dataset containing 5 points:

D={0,2,3,7,9}D = \{0, 2, 3, 7, 9\}

We want to partition DD into K=2K = 2 clusters: Cluster AA and Cluster BB.

Initial Setup (Round 0)

  • Random initial centroid locations: cA=1.0c_A = 1.0, cB=4.0c_B = 4.0.

Consolidated Iteration Walkthrough Table

The table below deduplicates and synthesizes the progressive iteration sequence into a single unified step-by-step record:

Round Centroid cAc_A Centroid cBc_B Distance to cAc_A and cBc_B for each point x∈Dx \in D Point Assignments New Centroid Calculation Convergence Check
0 1.01.0 (init) 4.04.0 (init) • x=0x=0: ∣0−1∣=1|0-1|=1 vs ∣0−4∣=4  ⟹  A|0-4|=4 \implies A
• x=2x=2: ∣2−1∣=1|2-1|=1 vs ∣2−4∣=2  ⟹  A|2-4|=2 \implies A
• x=3x=3: ∣3−1∣=2|3-1|=2 vs ∣3−4∣=1  ⟹  B|3-4|=1 \implies B
• x=7x=7: ∣7−1∣=6|7-1|=6 vs ∣7−4∣=3  ⟹  B|7-4|=3 \implies B
• x=9x=9: ∣9−1∣=8|9-1|=8 vs ∣9−4∣=5  ⟹  B|9-4|=5 \implies B
CA={0,2}C_A = \{0, 2\}
CB={3,7,9}C_B = \{3, 7, 9\}
• cA=0+22=1.0c_A = \frac{0 + 2}{2} = 1.0
• cB=3+7+93=193≈6.33c_B = \frac{3 + 7 + 9}{3} = \frac{19}{3} \approx 6.33
Initial state
1 1.01.0 6.336.33 • x=0x=0: ∣0−1∣=1|0-1|=1 vs ∣0−6.33∣=6.33  ⟹  A|0-6.33|=6.33 \implies A
• x=2x=2: ∣2−1∣=1|2-1|=1 vs ∣2−6.33∣=4.33  ⟹  A|2-6.33|=4.33 \implies A
• x=3x=3: ∣3−1∣=2|3-1|=2 vs ∣3−6.33∣=3.33  ⟹  A|3-6.33|=3.33 \implies A
• x=7x=7: ∣7−1∣=6|7-1|=6 vs ∣7−6.33∣=0.67  ⟹  B|7-6.33|=0.67 \implies B
• x=9x=9: ∣9−1∣=8|9-1|=8 vs ∣9−6.33∣=2.67  ⟹  B|9-6.33|=2.67 \implies B
CA={0,2,3}C_A = \{0, 2, 3\}
CB={7,9}C_B = \{7, 9\}
• cA=0+2+33=53≈1.67c_A = \frac{0 + 2 + 3}{3} = \frac{5}{3} \approx 1.67
• cB=7+92=162=8.0c_B = \frac{7 + 9}{2} = \frac{16}{2} = 8.0
Point x=3x=3 flipped from BB to AA! Continues.
2 1.671.67 8.08.0 • x=0x=0: ∣0−1.67∣=1.67|0-1.67|=1.67 vs ∣0−8∣=8  ⟹  A|0-8|=8 \implies A
• x=2x=2: ∣2−1.67∣=0.33|2-1.67|=0.33 vs ∣2−8∣=6  ⟹  A|2-8|=6 \implies A
• x=3x=3: ∣3−1.67∣=1.33|3-1.67|=1.33 vs ∣3−8∣=5  ⟹  A|3-8|=5 \implies A
• x=7x=7: ∣7−1.67∣=5.33|7-1.67|=5.33 vs ∣7−8∣=1  ⟹  B|7-8|=1 \implies B
• x=9x=9: ∣9−1.67∣=7.33|9-1.67|=7.33 vs ∣9−8∣=1  ⟹  B|9-8|=1 \implies B
CA={0,2,3}C_A = \{0, 2, 3\}
CB={7,9}C_B = \{7, 9\}
• cA=0+2+33≈1.67c_A = \frac{0 + 2 + 3}{3} \approx 1.67
• cB=7+92=8.0c_B = \frac{7 + 9}{2} = 8.0
Centroid locations did not change!
3 1.671.67 8.08.0 Identical distances and assignments as Round 2. CA={0,2,3}C_A = \{0, 2, 3\}
CB={7,9}C_B = \{7, 9\}
cA=1.67c_A = 1.67, cB=8.0c_B = 8.0 CONVERGED (Algorithm terminates).

SSE Evaluation of the Final Clustering:

For Cluster AA with centroid cA=1.67c_A = 1.67:

SSEA=(0−1.67)2+(2−1.67)2+(3−1.67)2=2.7889+0.1089+1.7689≈4.67\text{SSE}_A = (0 - 1.67)^2 + (2 - 1.67)^2 + (3 - 1.67)^2 = 2.7889 + 0.1089 + 1.7689 \approx 4.67

For Cluster BB with centroid cB=8.0c_B = 8.0:

SSEB=(7−8.0)2+(9−8.0)2=(−1.0)2+(1.0)2=1.0+1.0=2.0\text{SSE}_B = (7 - 8.0)^2 + (9 - 8.0)^2 = (-1.0)^2 + (1.0)^2 = 1.0 + 1.0 = 2.0

Total Final SSE:

SSEtotal=SSEA+SSEB≈4.67+2.0=6.67\text{SSE}_{\text{total}} = \text{SSE}_A + \text{SSE}_B \approx 4.67 + 2.0 = 6.67


3.4 Limitations of K-Means

While computationally fast (O(n⋅K⋅I⋅d)O(n \cdot K \cdot I \cdot d) where II is iterations), K-Means has several well-documented drawbacks:

  1. Vulnerability to Initial Seeds: Bad initial centroids can trap the algorithm in poor local minima or create empty clusters. (Remedy: K-Means++ initialization).
  2. Differing Cluster Sizes & Densities: K-Means assumes clusters have roughly equal variance and density. When a dense cluster sits next to a sparse cluster, K-Means splits the sparse cluster or merges parts of both.
  3. Non-Globular (Non-Convex) Shapes: K-Means uses Euclidean distance, which inherently forms convex Voronoi cells. It fails on concentric circles, interlocking spirals, or crescent shapes.
  4. Sensitivity to Outliers: Extreme points dramatically distort the arithmetic mean calculation of centroids.

3.5 Selecting the Optimal Number of Clusters (KK)

1. The Elbow Method

Plot the objective cost (SSE\text{SSE}) as a function of KK:

  • As KK increases from 11 to nn, SSE monotonically decreases (reaching 00 when K=nK = n).
  • We look for an elbow point: the value of KK where the rate of decrease drops sharply, indicating diminishing returns for adding further clusters.
flowchart LR K1["K=1: High SSE"] --> K2["K=2: Sharp Drop"] K2 --> K3["K=3: Elbow Point (Optimal)"] K3 --> K4["K=4: Marginal Reduction"] K4 --> K5["K=5: Diminishing Returns"]

2. The Silhouette Coefficient

The Silhouette Coefficient measures how well each point is matched to its own cluster compared to neighboring clusters without requiring ground truth labels.

For each data point ii:

  1. a(i)a(i): The average distance from point ii to all other points in the same cluster (intra-cluster distance).
  2. b(i)b(i): The minimum average distance from point ii to all points in any other single cluster (nearest-cluster distance).

The silhouette score s(i)s(i) for point ii is:

s(i)=b(i)−a(i)max⁡(a(i),b(i))s(i) = \frac{b(i) - a(i)}{\max(a(i), b(i))}

Interpretation of s(i)s(i):

  • s(i)≈+1s(i) \approx +1: The point is well inside its own cluster and far from neighbors (b(i)≫a(i)b(i) \gg a(i)).
  • s(i)≈0s(i) \approx 0: The point lies on or very near the decision boundary between two clusters (b(i)≈a(i)b(i) \approx a(i)).
  • s(i)≈−1s(i) \approx -1: The point has likely been assigned to the wrong cluster (a(i)≫b(i)a(i) \gg b(i)).

The global Mean Silhouette Score across all points provides an effective metric to select the optimal KK.


4. DBSCAN (Density-Based Spatial Clustering of Applications with Noise)

4.1 Foundational Concept

DBSCAN identifies clusters as contiguous regions of high point density separated by regions of low density. Unlike K-Means, DBSCAN:

  • Does not require specifying the number of clusters KK in advance.
  • Can discover clusters of arbitrary, non-globular shapes.
  • Explicitly detects and isolates noise points and outliers.

4.2 Key Hyperparameters

DBSCAN requires two essential parameters:

  1. ε\varepsilon (Eps / Radius): The maximum neighborhood distance to scan around any given point.
  2. MinPts\text{MinPts} (Minimum Points): The minimum number of points required within the ε\varepsilon-neighborhood of a point (including the point itself) to form a dense region.

The ε\varepsilon-neighborhood of point pp is defined as:

Nε(p)={q∈D∣dist(p,q)≤ε}N_\varepsilon(p) = \{q \in D \mid \text{dist}(p, q) \le \varepsilon\}


4.3 Point Classifications

DBSCAN categorizes every data point into one of three distinct types:

flowchart TD Point["Evaluate Point p"] --> Cond1{"|N_Eps(p)| >= MinPts?"} Cond1 -->|Yes| Core["Core Point\n(Dense Interior Node)"] Cond1 -->|No| Cond2{"Is p in neighborhood\nof a Core Point?"} Cond2 -->|Yes| Border["Border Point\n(Edge of Cluster)"] Cond2 -->|No| Noise["Noise Point\n(Isolated Outlier)"]
  1. Core Point: A point pp is a Core Point if its ε\varepsilon-neighborhood contains at least MinPts\text{MinPts} points:

    ∣Nε(p)∣≥MinPts|N_\varepsilon(p)| \ge \text{MinPts}

    Core points reside in the interior of a cluster.

  2. Border Point: A point pp is a Border Point if it has fewer than MinPts\text{MinPts} neighbors (∣Nε(p)∣<MinPts|N_\varepsilon(p)| < \text{MinPts}), but falls within the ε\varepsilon-neighborhood of at least one Core Point q∈Nε(p)q \in N_\varepsilon(p). Border points form the outer boundaries of clusters.

  3. Noise Point (Outlier): A point that is neither a Core Point nor a Border Point. It belongs to no cluster.


4.4 Density Reachability and Connectivity

To formally group points into clusters, DBSCAN establishes connectivity relations:

  1. Directly Density-Reachable: Point pp is directly density-reachable from point qq with respect to ε\varepsilon and MinPts\text{MinPts} if:

    • qq is a Core Point.
    • p∈Nε(q)p \in N_\varepsilon(q) (i.e., dist(p,q)≤ε\text{dist}(p, q) \le \varepsilon).
  2. Density-Reachable: Point pp is density-reachable from point qq if there exists an ordered chain of points p1,p2,…,pmp_1, p_2, \dots, p_m where p1=qp_1 = q and pm=pp_m = p such that each pi+1p_{i+1} is directly density-reachable from pip_i. (This relation is asymmetric when ending on a border point).

  3. Density-Connected: Point pp is density-connected to point qq if there exists a common core point oo such that both pp and qq are density-reachable from oo. (This relation is symmetric).

A DBSCAN Cluster is defined as a maximal set of density-connected points.


4.5 Algorithmic Steps of DBSCAN

  1. Label all points as Core, Border, or Noise based on their ε\varepsilon-neighborhood point count.
  2. Eliminate all Noise points from initial cluster consideration.
  3. For each unvisited Core point pp:
    • Spawn a new cluster CC.
    • Find all points that are density-connected to pp (using Breadth-First or Depth-First neighborhood expansion) and add them to CC.
  4. Assign each Border point to the cluster of its closest Core point.
  5. Remaining unassigned points are designated as Noise.

4.6 Comparative Summary: K-Means vs. DBSCAN

Property K-Means DBSCAN
Number of Clusters (KK) Must be explicitly specified in advance Determined automatically by the algorithm
Cluster Geometry Spherical, convex, globular clusters Arbitrary shapes (crescents, rings, spirals)
Noise & Outlier Handling Highly sensitive; all points forced into clusters Robust; isolates noise points automatically
Handling Varied Density Struggles with varying densities Fails when clusters have significantly different densities
Key Parameters KK (number of clusters) ε\varepsilon (neighborhood radius) and MinPts\text{MinPts}
Computational Complexity O(n⋅K⋅I⋅d)O(n \cdot K \cdot I \cdot d) (Very fast) O(nlog⁡n)O(n \log n) with spatial indexing (e.g. k-d tree), O(n2)O(n^2) worst case

5. Cluster Validation Concepts

Cluster validation evaluates the objective quality, validity, and statistical reliability of clustering results.

5.1 The Three Validation Indices

flowchart TD Val["Cluster Validation Indices"] Val --> Ext["External Index\n(Matches clusters to external labels, e.g. Entropy, Purity)"] Val --> Int["Internal Index\n(Measures structure from data alone, e.g. SSE, Silhouette)"] Val --> Rel["Relative Index\n(Compares two alternative clusterings, e.g. Delta SSE)"]
  1. External Index: Measures the agreement between the discovered cluster labels and an externally provided set of true class labels (ground truth).

    • Examples: Entropy, Purity, Rand Index, Adjusted Mutual Information (AMI).
    • Useful when evaluating clustering algorithms on labeled benchmark datasets.
  2. Internal Index: Evaluates the goodness of a clustering structure using only the data itself, without reference to any external labels.

    • Examples: Sum of Squared Errors (SSE), Silhouette Coefficient, Davies-Bouldin Index, Calinski-Harabasz Index.
  3. Relative Index: Used to compare two different clusterings generated by varying parameter values (e.g., comparing K=2K=2 vs K=3K=3, or comparing K-Means vs DBSCAN). Often implemented using an internal or external index as the criterion.


5.2 Measuring Cluster Validity via Matrix Correlation

A classic internal validation approach correlates the Proximity Matrix with an Ideal Similarity Matrix:

  1. Proximity Matrix (PP): An n×nn \times n matrix where entry Pij=dist(xi,xj)P_{ij} = \text{dist}(\mathbf{x}_i, \mathbf{x}_j) records the pairwise distance between points.
  2. Ideal Similarity Matrix (YY): An n×nn \times n matrix defined by cluster assignments:

Yij={1if xi and xj belong to the same cluster0if xi and xj belong to different clustersY_{ij} = \begin{cases} 1 & \text{if } \mathbf{x}_i \text{ and } \mathbf{x}_j \text{ belong to the same cluster} \\ 0 & \text{if } \mathbf{x}_i \text{ and } \mathbf{x}_j \text{ belong to different clusters} \end{cases}

  1. Correlation Calculation: Compute Pearson’s correlation coefficient between the upper triangular entries (n(n−1)/2n(n-1)/2 pairs) of PP and YY:
    • A strong correlation indicates that points belonging to the same cluster are geometrically close, while points in different clusters are distant.
    • Ordering the similarity matrix rows and columns according to cluster labels produces a clear block-diagonal pattern for well-separated clusters.

6. Dimensionality Reduction: PCA and SVD

6.1 The Curse of Dimensionality

Real-world datasets often possess hundreds or thousands of features (e.g., text document term vectors, genetic markers, image pixel matrices). High dimensionality causes severe problems:

  • Data Sparsity: The volume of the feature space grows exponentially, causing all points to become equidistant from each other (rendering distance-based metrics meaningless).
  • Computational Bottlenecks: Time complexity scales with feature count dd.
  • Redundancy and Noise: Many features are correlated or irrelevant, obscuring genuine cluster boundaries.

6.2 Latent Factor Models and SVD

Dimensionality reduction assumes that the observed high-dimensional data actually resides near a lower-dimensional latent subspace.

Singular Value Decomposition (SVD) factorizes an n×dn \times d centered data matrix XX into three matrices:

X=UΣVTX = U \Sigma V^T

where:

  • UU is an n×nn \times n orthogonal matrix (left singular vectors representing data points in latent space).
  • Σ\Sigma is an n×dn \times d diagonal matrix containing singular values (measuring the variance explained by each factor).
  • VTV^T is a d×dd \times d orthogonal matrix (right singular vectors representing feature loadings).

6.3 Principal Component Analysis (PCA)

Principal Component Analysis (PCA) is an unsupervised linear technique that projects data onto orthogonal axes (Principal Components) that successively maximize the variance of the data:

  1. The 1st Principal Component (PC1PC_1) aligns with the direction of maximal variance.
  2. The 2nd Principal Component (PC2PC_2) is orthogonal to PC1PC_1 and maximizes remaining variance.
# Practical Dimensionality Reduction Pipeline with Scikit-Learn
from sklearn.decomposition import PCA
from sklearn.preprocessing import StandardScaler
from sklearn.cluster import KMeans

# 1. Standardize features (essential prior to PCA)
scaler = StandardScaler()
X_scaled = scaler.fit_transform(X)

# 2. Reduce dimensionality to 2 Principal Components for 2D visualization
pca = PCA(n_components=2)
X_pca = pca.fit_transform(X_scaled)

# 3. Cluster in the reduced latent space
kmeans = KMeans(n_clusters=3, random_state=42)
labels = kmeans.fit_predict(X_pca)

By reducing high-dimensional data (such as the 4D Iris dataset or 1000D customer embeddings) to 2D or 3D, PCA enables direct human visualization of discovered clusters while eliminating noise.


7. Review and Key Takeaways

  1. Clustering groups unlabelled data such that intra-cluster similarity is maximized and inter-cluster similarity is minimized.
  2. K-Means iteratively assigns points to the nearest centroid and recomputes centroids as the mean of assigned points, minimizing the Sum of Squared Errors (SSE).
  3. The Elbow Method and Silhouette Coefficient provide objective criteria to determine the optimal cluster count KK.
  4. DBSCAN discovers clusters of arbitrary shapes and isolates outliers based on density parameters (ε\varepsilon and MinPts\text{MinPts}), categorizing points as Core, Border, or Noise.
  5. Cluster validity is measured via External Indices (against true labels), Internal Indices (SSE, Silhouette, Proximity-Similarity Correlation), and Relative Indices.
  6. PCA mitigates the curse of dimensionality by projecting data onto orthogonal directions of maximum variance prior to clustering and visualization.