Unsupervised Learning
Introduction
Unsupervised learning is a type of machine learning where the model is provided with input data without corresponding output labels. The goal is to find hidden patterns, structures, or groupings in the data. Unlike supervised learning, there are no target variables, and the model must infer relationships on its own.
Given data $\mathbf{X} = \{x_1, x_2, \dots, x_n\}$, the aim of unsupervised learning is to find:
Clusters or groups of similar instances
Low-dimensional representations (feature extraction)
Anomalies or outliers
Applications
Unsupervised learning is widely used in:
Market segmentation: Grouping customers with similar buying patterns
Anomaly detection: Fraud detection, network intrusion
Data compression: Dimensionality reduction using PCA
Recommender systems: Discovering latent interests or preferences
A company has sales data for 1000 customers but no labels. Using clustering algorithms, they identify 3 distinct customer segments:
High-value, frequent buyers
Low-value, infrequent buyers
Occasional buyers with seasonal trends
Types of Unsupervised Learning
Clustering: Partitioning data into groups of similar items (e.g., k-means, hierarchical clustering)
Dimensionality Reduction: Representing data in lower dimensions while preserving structure (e.g., PCA, t-SNE)
Association Rules: Discovering rules between variables in datasets (e.g., market basket analysis)
Clustering Example
Consider 2D points representing customers’ annual income and spending score. Using k-means clustering:

Explanation: The algorithm groups similar customers into clusters based on proximity in the 2D space. Each cluster can be analyzed for marketing strategies.
Dimensionality Reduction Example
Principal Component Analysis (PCA) projects high-dimensional data into lower dimensions:

Explanation: PC1 captures maximum variance along the data, allowing dimensionality reduction from 2D to 1D while preserving most information.