Unlike supervised learning, unsupervised learning does not involve learning a mapping function based on paired input-output examples. Instead, the learning algorithm is provided with a dataset consisting entirely of unlabeled data and is tasked with discovering inherent structure, patterns, or relationships within it.
Unsupervised learning is valuable because most of the data in the world is unlabeled. Imagine trying to label every photo on the internet, every customer purchase record, or every medical scan. The cost and time required would be enormous.
Unsupervised learning lets us find patterns in this sea of unlabeled data. While we may not know the "correct" answer in advance, we can still discover useful structure. For example, an online store might use unsupervised learning to group customers with similar purchasing behaviors, even without knowing in advance what those groups look like.
Because unlabeled data is vastly more abundant and cheaper to collect than human-annotated data, machine learning methods that support unsupervised learning are exceptionally valuable across data science.
Imagine handing a child a giant box of mixed, unlabeled Lego bricks. Without telling them what to build or providing an instruction manual (no "supervisor"), the child naturally starts organizing the bricks: putting red blocks in one pile, long blocks in another, and wheels in a third. Unsupervised learning works the same wayβit searches for natural groupings, similarities, and patterns in data without ever being told what the "right answer" is.
The objective of unsupervised learning can be as straightforward as uncovering hidden patterns within a dataset, or it can involve feature learning. Feature learning enables a system to automatically discover the representations needed to analyze raw data. Without receiving explicit targets, unsupervised methods organize complex information into meaningful structures.
Clustering algorithms group together samples that exhibit similar traits. The goal is to discover a natural partitioning of the dataset that highlights underlying structure. For instance, an algorithm given a collection of untagged photos of dogs can analyze visual likenesses and automatically group similar dog images together.
Clustering is one of the most common unsupervised learning tasks. The goal is to partition data into groups, or clusters, such that items within the same cluster are more similar to each other than to items in other clusters.
There are many approaches to clustering. One of the simplest is k-means clustering, where the algorithm chooses a number of clusters and then repeatedly assigns each data point to the nearest cluster center and updates the centers. The algorithm continues until the clusters stabilize. Clustering is used in customer segmentation, image compression, and document organization, among many other applications.
Density estimation aims to model the underlying probability distribution of the input data itself. Because the algorithm focuses purely on the distribution of input features without needing target values, it operates as a purely unsupervised task. Once trained, the model can estimate the probability of encountering new data points or generate brand-new synthetic samples from the learned distribution.
Dimensionality reduction re-represents complex data using fewer variables or features while preserving its most critical information. This technique is particularly valuable for visualizing and compressing high-dimensional data, which are datasets containing a large number of attributes relative to the overall number of samples. For example, a single image might contain thousands of pixels, each representing a feature. While having many features can be useful, it also makes analysis more difficult.
High-dimensional data can suffer from what is called the "curse of dimensionality." As the number of dimensions increases, the data becomes sparse, and distance measures become less meaningful. Dimensionality reduction techniques reduce the number of features while preserving the essential structure of the data, making it easier to visualize and analyze.
One of the most common dimensionality reduction techniques is principal component analysis (PCA) , which finds the directions of maximum variance in the data and projects the data onto those directions.
Powering anomaly detection systems to flag unusual transactions, such as potential credit card fraud, by detecting data points that deviate from normal behavior.