ElemedexA pocket encyclopedia of AI architectures

Glossary (TM) › Machine learning fundamentals

TM007

Classification

Also: classifier

In Spanish: Clasificación

The task of assigning each input to a category from a set fixed in advance: spam or not, cat or dog, positive or negative review.

To classify is to predict a discrete label. Chollet (2021) distinguishes binary classification (two exclusive classes), multiclass classification (more than two, like the digits 0 to 9) and multilabel classification (a photo may contain a cat and a dog) (2021, ch. 4). It is the emblematic task of supervised learning and the trade of many Pokédex species: the Perceptron, Naive Bayes filtering spam, AlexNet recognizing images, or BERT judging reviews and inferences.

Geometrically, a classifier draws a decision boundary in the space of the data. In practice almost all classifiers return a probability per class (with softmax, in neural networks), and the answer is the most probable class; they are trained with cross-entropy as their loss function. Even a language model is, technically, a classifier: at each step it picks one class out of the tens of thousands in its vocabulary.

Accuracy (the percentage of correct answers) is misleading when classes are imbalanced. Witten et al. (2017) tell of a system meant to detect when a cow was in heat that always predicted "no"; since the cycle lasts about 30 days, it was right 97% of the time and useless (2017, p. 180).

What matters philosophically is that the classes are fixed by whoever designs the task: the classifier does not discover categories, it learns to draw the ones it was given. And many of them lack sharp borders. Asked whether a banana is unripe, ripe, or rotten, different annotators disagree, because those categories have no objective boundaries (Chollet, 2021, sec. 5.1.1); the old problem of vagueness returns as "label noise." When the goal is to discover the categories, the task is clustering. To look inside a symbolic classifier, try the decision-tree lab.

Sources

  • Chollet, F. (2021). Deep learning with Python (2nd ed.). Manning Publications. §
  • Witten, I. H., Frank, E., Hall, M. A., & Pal, C. J. (2017). Data mining: Practical machine learning tools and techniques (4th ed.). Morgan Kaufmann. https://doi.org/10.1016/C2015-0-02071-8 §