Classification: Multi-class classification

  • Multi-class classification extends binary classification to handle more than two classes, often by breaking the problem down into multiple binary classifications.

  • In multi-class classification, each example is assigned to only one class, like classifying handwritten digits (0-9).

  • If an example can belong to multiple classes, it's called multi-label classification, which is a distinct but related concept.

  • Multi-class classification can be achieved by creating a series of binary classifiers, each distinguishing between a subset of classes.

Multi-class classification can be treated as an extension ofbinary classificationto more than two classes. If each example can only beassigned to one class, then the classification problem can be handled as abinary classification problem, where one class contains one of the multipleclasses, and the other class contains all the other classes put together.The process can then be repeated for each of the original classes.

For example, in a three-class multi-class classification problem,where you're classifying examples with the labelsA,B, andC, you could turn the problem into two separate binary classificationproblems. First, you might create a binary classifier that categorizes examplesusing the labelA+B and the labelC. Then, you could create a secondbinary classifier that reclassifies the examples that are labeledA+Busing the labelA and the labelB.

An example of a multi-class problem is a handwriting classifier that takesan image of a handwritten digit and decides which digit, 0-9, is represented.

If class membership isn't exclusive, which is to say, an example can beassigned to multiple classes, this is known as amulti-label classificationproblem.

Multi-class classification is explored more deeply intheMulti-class neural networks section of theNeural Networksmodule.Key terms:

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-25 UTC.