Amazon segments millions of customers into clusters based on purchase frequency, average order value, product categories, and browsing behavior. K-Means identifies groups like "bargain hunters," "premium buyers," "seasonal shoppers," and "impulse buyers" to personalize marketing campaigns and product recommendations.
Features used: Purchase frequency, average order value, recency, product category preferences, browsing duration.
Elbow Method: Plotted SSE against k = 2 to 10. The elbow appeared at k = 4, indicating four natural customer segments.
Business impact: Personalized email campaigns increased conversion rates by 35% and reduced marketing spend by 20%.
Focus Question:
What method helps determine the optimal number of clusters in K-Means?A. Confusion Matrix | B. Elbow Method | C. ROC Curve | D. Cross-validation
Tip: K-Means minimizes within-cluster sum of squares (SSE). The Elbow Method finds where SSE stops decreasing significantly — that's your optimal k.
Case 2
Bioinformatics Clustering
Gene Expression Clustering (Hierarchical)
Researchers cluster gene expression data from microarray experiments to identify genes with similar behavior across conditions. Hierarchical clustering produces dendrograms revealing relationships between thousands of genes, identifying groups that are co-regulated or involved in the same biological pathways. This helps understand disease mechanisms and drug targets.
Data: Expression levels of 20,000+ genes across 50 tissue samples (high-dimensional data).
Method: Agglomerative hierarchical clustering with average linkage and Euclidean distance.
Dendrogram insights: Cutting at height = 15 revealed 7 major gene clusters, each corresponding to known biological pathways (immune response, cell cycle, metabolism).
Discovery: One cluster contained 3 previously unknown genes that correlated with tumor growth — potential drug targets.
Focus Question:
Agglomerative hierarchical clustering starts with how many clusters?A. Zero | B. One | C. k clusters | D. n clusters (one per data point)
Tip: Dendrograms let you cut at different heights to get different numbers of clusters — great for exploring data structure at multiple granularity levels.
Case 3
Text Clustering for Organization
News Article Categorization (TF-IDF + Clustering)
A major news aggregator uses document clustering to automatically group articles by topic without manual labeling. Articles are converted to numerical vectors using TF-IDF, then clustered using K-Means. Cosine similarity measures document similarity in the high-dimensional TF-IDF space. The Silhouette Coefficient evaluates cluster quality.
Similarity measure: Cosine similarity (preferred over Euclidean for sparse text vectors — measures angle, not magnitude).
Clustering: K-Means with k = 8 (politics, sports, technology, business, entertainment, health, science, world).
Evaluation: Silhouette Coefficient of 0.58 — good clustering structure. Manual review confirmed 92% of articles correctly grouped.
Focus Question:
Why is cosine similarity preferred for text clustering?A. It is faster | B. It measures angle, not magnitude — better for sparse vectors | C. It works with categorical data | D. It handles missing values
Tip: Silhouette Coefficient ranges from -1 to +1. Values above 0.5 indicate good clustering structure. Cosine similarity is ideal for high-dimensional sparse data like TF-IDF vectors.