ENES

Supervised and unsupervised learning

Two ways a machine learns: from examples with answers, or by finding patterns on its own.

On the left, examples tagged cat or dog teach a model a rule; on the right, untagged dots are sorted into two groups the model found on its own

In supervised learning, every training example comes with the right answer attached, called a label. Thousands of emails marked "spam" or "not spam", photos of skin marked "benign" or "malignant", past apartments with their sale price. The model studies the pairs and learns a rule that maps input to answer, so it can predict the label for something new. Sorting into categories is called classification; predicting a number, like a price, is regression.

In unsupervised learning, there are no answers. The model gets raw data and looks for structure: customers that behave alike (clustering), transactions that look nothing like the rest (anomaly detection, useful against fraud), or a simpler way to describe the data. Nobody tells it what the groups mean; a person has to look at them and decide whether they are useful.

The difference matters because labels are expensive: someone has to write them, often by hand. That is why a third approach became central: self-supervised learning, where the data labels itself. Large language models learn this way, by hiding the next word of a real text and trying to guess it, which turns the whole internet into practice material without anyone labeling it.

Keep in mind

Go deeper

Related terms

More in AI