Machine Learning

Class (Machine Learning)

A class is one of the discrete categories a classification model assigns to each input, such as approved or declined for a loan application, or invoice, contract, and other for a document sorter.

What is a class in machine learning?

A class is a named category that a classification model chooses between. Each training record carries a label stating which class it belongs to, and the model learns to assign one of those classes to new records. A problem with two classes, such as “will renew” and “will not renew,” is binary classification. A problem with more, such as sorting incoming mail into “invoice,” “purchase order,” “contract,” and “correspondence,” is multi-class classification. When a record can belong to several classes at once, such as a support ticket tagged with both “billing” and “outage,” the task is multi-label.

The business defines the classes before training starts, and the quality of that definition shapes everything after it. Classes that overlap, that reviewers interpret differently, or that cover cases nobody can recognize from the input produce noisy labels and a weak model.

Classes in practice

A law firm building a document classifier for incoming matters starts by listing the document types its intake team actually handles. The team discovers that “agreement” and “contract” were being used interchangeably and that “other” was absorbing a third of the documents. Merging the first two and splitting “other” into three real categories improves the model more than any change to the algorithm.

Class balance, which is how evenly the classes appear in the training data, and the confusion matrix, which shows which classes get mistaken for which, are the first things to examine once a classifier exists.

← Back to AI Glossary