Models and training

Classification

Classification is a machine learning task in which a model assigns each input, such as an email, image, transaction or document, to one of a set of predefined categories, for example spam or not spam, or which team should handle it.

Classification means sorting things into labelled buckets automatically. Is this email a complaint, a sales enquiry or an invoice? Is this transaction suspicious? Does this photo show a damaged item? For a business buyer it is one of the most practical forms of AI, because most back-office work starts with deciding what something is and where it should go.

How it works

There are two broad ways to build a classifier. The traditional route is machine learning: collect examples that people have already labelled, train a model on them, and test it on examples it has not seen. This suits high volumes, stable categories and tabular data such as transactions. The newer route is to ask a language model to choose a label from a list, describing each category in the prompt and asking for structured output. That needs few or no labelled examples and copes well with messy text, but each call costs more and results can drift when the model is updated.

Variants matter. Binary classification has two outcomes. Multi-class picks one of many. Multi-label allows several at once, such as a ticket that is both urgent and about billing. A support inbox build might classify each incoming message by topic and urgency, route it to the right queue, and send anything below a confidence threshold to a person.

What it means for cost

The model is rarely the hard part. A quote mostly reflects:

  • Category design. Overlapping or vague categories cause errors no model can fix. Agreeing clear definitions with examples is cheap and saves weeks.
  • Labelled examples. Training a classical model needs training data; even a prompt-based approach needs a labelled test set for evals.
  • Cost of mistakes. If a wrong label sends a refund to the wrong place, the build needs thresholds, review queues and logging.
  • Volume. At very high volumes a small trained model is usually cheaper to run than a language model call per item.

Ask a builder how they will measure precision and recall for each category, not only overall accuracy.

Common mistakes

Reporting a single accuracy figure hides problems when categories are uneven. If nearly all emails are routine, a model that labels everything routine looks accurate and is useless. Per-category results and a confusion matrix tell the real story.

Common questions

What is the difference between classification and clustering?

Classification uses categories you define in advance. Clustering groups items by similarity without predefined labels and leaves people to decide what each group means. Clustering is useful for discovering categories; classification is for applying them.

How many labelled examples does a classifier need?

There is no fixed number. It depends on how many categories there are, how distinct they are and which approach is used. A prompt-based classifier can start with a small test set; a trained model usually needs a meaningful number of examples per category, especially rare ones.

Related terms

Pricing a build that involves Classification? Send the brief and get a fixed price set next to the market range.Get a quote