liveBook · Manning

Single-label categorical classification

As explained in Deep Learning with Python, Third Edition

A classification task in which each example belongs to exactly one class from a set of mutually exclusive classes.

Single-label categorical classification predicts one class per example. A neural network uses one output unit per class, with softmax producing the class probabilities. section 20.1.6

Keras output layer

For one-hot encoded targets, finish a dense network with Dense(num_classes, activation="softmax") and compile it with categorical_crossentropy. Integer targets instead use sparse_categorical_crossentropy. section 20.1.6

How Deep Learning with Python, Third Edition covers it

How deep it goes
Specifies output width, activation, and target-dependent loss, but stops short of explaining training or probability computation.
Examples
Uses a Keras dense network with two hidden layers and a softmax output.
What you can do after
Build it from scratch with Keras by matching output units, activation, loss, and target encoding.
How it connects
Connects dense networks with softmax, categorical crossentropy, sparse categorical crossentropy, and one-hot encoding.

Also explained in

Compare how 2 books explain single-label categorical classification →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with Python, Third Edition. The section links point to the parts of the book it draws on.