Unsupervised learning is machine learning on data that comes with no answers attached. There are no labels saying “spam” or “$412,500”, only the inputs themselves. The algorithm’s job is to find structure in them: groups of similar items, a simpler description of the data, or what normal looks like so the unusual stands out.
It matters because labels are expensive and raw data is cheap. A retailer has millions of purchase histories and no one has tagged them with customer types. A factory has years of sensor logs and very few examples of the failures it cares about. Unsupervised methods get value out of that data as it is.
The main kinds
- Clustering divides examples into groups of similar ones. k-means, the classic, alternates between assigning each point to its nearest cluster centre and moving each centre to the mean of its points.
- Dimensionality reduction finds a smaller set of features that keeps most of the information. PCA finds the directions along which the data varies most; an autoencoder learns to squeeze each input through a narrow layer and rebuild it.
- Anomaly detection models what typical data looks like and flags points that don’t fit, such as an unusual card transaction.
- Density estimation learns the probability distribution the data came from, which is the basis for generative models that can produce new samples.
Where it fits
The diagram’s missing column of answers is the whole difference from supervised learning. Without a target there is no single number to minimize that says “correct”, so every method brings its own definition of good structure: tight clusters, low reconstruction error, high likelihood.
Self-supervised learning is a close relative. It also starts from unlabeled data, but turns it into a supervised task by hiding part of each example and predicting it. Predicting the next word of web text is how large language models are pre-trained.
The catch
Clustering is ill-posed: nothing in the data says which grouping is right. The standard example from the Deep Learning textbook is a set of images of red cars, red trucks, grey cars and grey trucks. Ask for two clusters and one algorithm may split cars from trucks while another splits red from grey. Both are valid, and only one may be useful to you. That’s why unsupervised results need a human, or a downstream task, to judge whether the structure found is the structure you wanted.