Classification
Last updated June 14, 2026
What is Classification in simple terms?
In simple terms, classification is teaching a computer to sort things into labeled groups. Show it enough examples of each — "this is a dog, that's a cat" — and it learns to sort new things too.
What is Classification?
Classification is a machine learning task in which a model sorts each input into one of a fixed set of predefined categories — deciding, for example, whether an email is spam or not, or which of several diseases an X-ray most likely shows.
Classification is one of the most common jobs we ask machine learning to do, and the idea is refreshingly plain: take something in, and decide which named category it belongs to. The categories are fixed and chosen in advance — a model built to tell apart handwritten digits has exactly ten possible answers (0 through 9), and a model that screens product reviews might have just two (positive or negative). The model's task is never to invent a new label; it's to pick the best-fitting one from the list it was given. That "pick from a fixed menu" quality is what makes classification a distinct, well-defined task rather than a vague notion of "the AI figuring things out."
How does a model learn to do this? Almost always by example. You collect a pile of inputs that have already been correctly labeled — thousands of reviews each marked positive or negative, say — and the model studies them, gradually picking up on the patterns that separate one category from another. Once trained, it can take a brand-new input it has never seen and assign it a category. Importantly, most classifiers don't just blurt out a single answer; under the hood they produce a confidence for each option — "I'm 92% sure this is spam" — and the highest one wins. That confidence is genuinely useful, because it lets a system flag the borderline cases where it's unsure and hand those to a person.
It's worth drawing one clean line early, because it's the most common point of confusion. Classification predicts a *category* — a discrete label from a set. Its sibling task, regression, predicts a *number* on a sliding scale, like a house price or tomorrow's temperature. "Will this customer cancel: yes or no?" is classification; "how many days until they cancel?" is regression. Many real systems quietly use both. Keep that distinction in mind and a surprising amount of machine learning suddenly slots into place, because a great many practical AI problems turn out to be one of these two shapes wearing different clothes.
Real-world example of Classification
Your bank's app flashes a notification: "Did you make this purchase?" Behind that question sits a classifier working in the background on every transaction you make. For each one, it weighs up dozens of clues — the amount, the location, the time of day, the type of merchant, how it compares to your usual habits — and sorts the transaction into one of two categories: ordinary or suspicious. Most land in "ordinary" and you never hear about them. The handful that look off get sorted into "suspicious," which triggers the alert. The bank didn't write a rule for every possible scam; it showed a model huge numbers of past transactions already labeled fraudulent or legitimate, and the model learned the patterns that tend to separate the two. Every "is this really you?" prompt is a classification decision reaching you in real time.
Related terms
Frequently asked questions about Classification
What is the difference between classification and regression?
They're the two main kinds of prediction in supervised machine learning, and the difference is in what they predict. Classification picks a category from a fixed set of labels — spam or not spam, which animal is in the photo, which of five fault types a machine has. Regression predicts a number on a continuous scale — a price, a temperature, an age. A quick test: if the answer is one of a handful of named options, it's classification; if the answer is a quantity that could fall anywhere in a range, it's regression.
How does classification work?
A classifier learns from labeled examples. You feed it many inputs that have already been correctly tagged with their category, and it gradually learns the patterns that distinguish one category from another. Once trained, it takes a new, unseen input and assigns it a category — usually by computing how confident it is in each possible label and choosing the most likely one. The quality of the result depends heavily on having enough correctly labeled examples that fairly represent what the model will meet in the real world.
What is classification used for?
An enormous range of everyday systems. Email spam filtering, flagging suspicious payments, sorting customer messages by topic so they reach the right team, medical tools that estimate which condition a scan most likely shows, content moderation that tags posts as allowed or not, and quality checks that mark a part as pass or fail on a production line. Any time the practical question is "which of these known categories does this belong to?", classification is the tool reaching for an answer.