Classification in Machine Learning: How Models Decide

LLM foundationsModels and inferencePublished By Simon Budziak

Classification is the machine learning task of assigning an input to one of a set of predefined categories. Spam or not, approve or escalate, which product line a complaint concerns. It is supervised learning, trained on labeled examples, and it quietly runs more business AI than generation does.

How does classification actually work?

A model learns the mapping from labeled history. Each training example pairs an input with its correct label, the classifier learns which features predict which label, and at inference it outputs a label with a probability. Binary tasks have two labels, multi-class tasks more, and the contrast with regression is that the output is a category rather than a number. It sits inside machine learning as the canonical supervised task, the mirror image of unsupervised learning, which finds structure without labels. The model only ever chooses among the labels it was given, so the label set is a design decision, not a detail.

Where does classification run in a business?

Anywhere a stream of items needs sorting. Ticket routing, lead scoring, invoice coding, fraud flags, content moderation and sentiment analysis are all classifiers, and anomaly detection is its one-sided cousin, deciding only “normal or not”. Modern language models changed the economics rather than the concept: a prompted LLM can classify without task-specific training, which makes small-volume classification cheap, while high-volume streams still favor a trained lightweight classifier for cost and speed. The buy signal is volume: past a few thousand items a day, a dedicated classifier usually beats prompting a large model on price and latency.

How do you judge whether a classifier is good?

Never by accuracy alone. A fraud model that says “legitimate” every time is 99 percent accurate and useless, because the classes are imbalanced. Judge it per class, on precision, the share of flagged items that were truly positive, and recall, the share of true positives it caught, and weigh the two by the cost of each mistake: a missed fraud costs more than a false alarm, a wrongly rejected customer may cost more than a missed upsell. The error costs come from the business, not the model, so set the operating threshold with the people who own the consequences.

This entry was drafted with AI assistance.

Frequently asked questions

What is classification in AI, in simple terms?

Sorting inputs into known buckets. The model reads an email, an image or a record and outputs one of the labels it was trained on, such as spam or not spam, along with how confident it is.

What is the difference between binary and multi-class classification?

Binary has two possible labels, like fraud or legitimate. Multi-class has more than two, like routing a ticket to one of eight departments. The mechanics are similar; the evaluation and the cost of mistakes differ per class.

Is classification the same as clustering?

No. Classification assigns inputs to labels defined in advance and learned from labeled data. Clustering discovers groups in unlabeled data without being told what the groups are.

Summarize this page with

Train your team to build this