Unsupervised Learning & Dimensionality Reduction
Finding Hidden Structure Without Labels
Not all data comes with labels. **Netflix** doesn't always know *why* a user watches a particular show—but it can discover hidden groups of similar users through **Clustering**. For **Visa**, the challenge is different: with hundreds of transaction features, **Dimensionality Reduction (PCA)** compresses the data into its most essential components without losing signal.
In this chapter, we explore **K-Means Clustering** for user segmentation, **PCA** for feature compression, and **Anomaly Detection** for catching outliers that don't belong to any cluster.
K-Means Clustering: User Segmentation
**K-Means** groups data points into **K** clusters by minimizing the distance between each point and its cluster center (centroid). For **Netflix**, this means grouping millions of users into "taste communities" (e.g., "Action Lovers," "Documentary Enthusiasts") without ever asking them to label themselves.
PCA: Compressing Complex Data
**Principal Component Analysis (PCA)** finds the directions of maximum variance in your data and projects it onto fewer dimensions. For **Visa**, a transaction might have 200 features (time, location, merchant type, etc.). PCA can compress these into 10-20 "principal components" that capture 95% of the information, making models faster and more robust.
Anomaly Detection: The Outlier Hunter
Anomaly Detection finds data points that don't belong to any cluster. For **Visa**, this is a second line of defense: even if a transaction passes rule-based checks, an anomaly detector can flag it as statistically "weird" compared to the user's typical behavior.
Practice Questions
Question 1
Why is K-Means called 'unsupervised'?
Question 2
What problem does PCA solve for Visa's 200-feature transaction data?