
Classification (Machine Learning)
Classification means that a computer program assigns a case to one of several predefined categories, such as labeling an email as spam or not spam. The program learns this assignment beforehand from many examples in which the correct category was already known.
Classification means: a computer program assigns something to one of several predetermined categories. An email ends up in the “Spam” folder or in the inbox. A photo shows a dog, a cat, or a horse. An X-ray image is classified as suspicious or unremarkable. What’s special about this: nobody prescribed the program fixed rules. Instead, it learned the assignment from many examples where the correct answer was already known. This kind of learning from prepared examples is called supervised learning.
The standard task behind many everyday services
Classification is probably the most common task in machine learning. Very many practical problems can be reduced to it. Is this credit card payment fraud or not? Is this comment abusive? What language is this text written in? As soon as the answer comes from a manageable list of possibilities, it’s a classification task.
It’s important to distinguish this from regression. In regression, a model predicts a number, such as the price of an apartment in euros. In classification, on the other hand, there are no intermediate values, only separate categories. There is nothing between “dog” and “cat.” Between 300,000 and 310,000 euros, however, there is plenty.
Economically, classification is interesting because it automates decisions that would otherwise have to be made by humans. A bank checks millions of payments every day. Doing this by hand would be prohibitively expensive. A model handles it in a fraction of a second, though never without errors.
From training example to decision boundary
At the outset there is a dataset with examples that already include the correct category. This annotation is called a label. For a spam filter, this would be thousands of emails that someone previously marked as spam or not spam. Collecting and labeling this data is often the most expensive part of the entire project.
During training, the model searches for patterns that separate the categories. You can imagine this as a boundary line. Every email is a point in a space spanned by features such as certain words, the sender’s address, or the number of links. The model draws a line so that as many spam points as possible lie on one side and the rest on the other. In modern methods, this boundary is extremely convoluted and exists in thousands of dimensions, but the idea remains the same.
In the end, a classifier usually doesn’t provide a hard answer, but probabilities: 92 percent spam, 8 percent not spam. Where the threshold is set is a decision made by the operator. A low threshold catches more spam but also filters out more legitimate emails. A common misconception is to use the raw accuracy rate as a measure of quality. If only one in a thousand payments is fraudulent, a model that always says “no fraud” achieves 99.9 percent accuracy and is nevertheless completely useless.
Classification in products and headlines
You encounter classification every day, usually without noticing it. The spam filter in your email program is one example, as is the automatic sorting of photos by person on your smartphone. Content moderation on social networks also works this way: a model classifies uploaded images and texts into categories such as harmless, violent, or spam.
In the news, the term often comes up in connection with criticism. When a system pre-sorts job applications or loan requests, that is a classification with significant consequences for those affected. Such models inherit biases from their training data. If certain groups were systematically disadvantaged there, the model repeats this pattern. The EU AI Act therefore classifies several such applications as high-risk.
Classification is also embedded in modern language models, albeit hidden. Upstream filters check every input to see whether it violates the usage policies. This is nothing other than a classifier with two categories. The technology is thus old and unspectacular, yet it remains a building block of almost every AI product.