Unsupervised Learning
Discovering Patterns Without Labels
Introduction
Unsupervised Learning is a type of machine learning where the
algorithm is trained on unlabeled data.
Unlike supervised learning, there are no input-output pairs.
The goal is to discover patterns, groupings, or hidden
structures in the data.
Key Idea:
“Let the machine figure out the structure of data by itself.”
• Real-Life Examples
• Market Segmentation: Grouping customers
based on buying behavior.
• Netflix & Spotify: Recommending shows/music
by clustering users with similar tastes.
• Anomaly Detection: Detecting fraud or unusual
activity in bank transactions.
• Image Segmentation: Grouping similar pixels in
images.
Types of Unsupervised Learning
• Types of Unsupervised Learning
• Clustering
– Grouping data points into clusters based on similarity.
– Algorithms:
• K-Means
• Hierarchical Clustering
• DBSCAN
• Dimensionality Reduction
– Reducing features while preserving important information.
– Algorithms:
• PCA (Principal Component Analysis)
• t-SNE
• Autoencoders
Advantages
• Works with unlabeled data
• Helps find hidden patterns
• Useful for visualization
Popular algorithms
• K-Means Clustering
• Groups data into K clusters.
• Example: Grouping students by their study habits.
• Steps:
– Choose K clusters.
– Assign points to nearest cluster center.
– Recalculate cluster centers.
– Repeat until stable.
• PCA (Principal Component Analysis)
• Reduces dimensionality of data.
• Example: A student dataset with 50 features can be reduced to
2–3 features for visualization.
Limitations
• Hard to evaluate
• Sensitive to noise
• May produce meaningless clusters
Applications
- Marketing: Customer segmentation
- Security: Anomaly detection
- Healthcare: Patient grouping
- NLP: Topic modeling
• Summary
• Unsupervised learning = finding patterns
without labels.
• Two main types: Clustering & Dimensionality
Reduction.
• Popular algorithms: K-Means, Hierarchical
Clustering, PCA, DBSCAN.
• Useful in exploration, segmentation, anomaly
detection, NLP, and vision.
Example: K-Means Clustering
Example: PCA (Dimensionality Reduction)