liveBook · Manning

Label

As explained in Deep Learning with Python, Third Edition

The desired output values that a model is trained to match for each input example.

A label is the class annotation assigned to a particular input. If a picture is annotated “dog,” that is its label; “dog” is also one of the possible classes the model can predict. The label supplies the target the prediction should match. section 4.0

Movie review labels

In the IMDb dataset, each review has a binary sentiment label: 0 means negative and 1 means positive. The training and test labels are stored separately in NumPy arrays alongside their respective review data. section 4.1.1

Listing 4.1 Loading the IMDb dataset
from keras.datasets import imdb

(train_data, train_labels), (test_data, test_labels) = imdb.load_data(
    num_words=10000
)

Load the IMDb reviews and their labels with Keras; train_labels and test_labels hold the expected outputs. section 4.1.1

A target is the broader term for the desired output: classification uses class labels, while a regression target can be a continuous value, such as a house price. A loss measures the distance between the prediction and the target, providing feedback for learning. section 4.0 section 1.4

The task determines how many labels an input can have. Binary classification chooses between two exclusive classes; multiclass classification chooses among more than two. In multilabel classification, an image containing both a cat and a dog can receive both labels. section 4.0

Collecting labels can require substantial manual work. A photo search project might first select its image categories and then tag uploaded images; a spam detector might need a separate, manually tagged dataset when private chats cannot be used. Label reliability matters for generalization, so budget time for data collection rather than focusing only on model improvements. section 6.1.2

How Deep Learning with Python, Third Edition covers it

How deep it goes
Defines labels and classification variants, then discusses collection and reliability without specifying an annotation protocol.
Examples
Illustrates labels with cat and dog images, binary movie-review sentiment, and manually tagged spam data.
What you can do after
Evaluate label needs and distinguish targets from predictions when preparing a classification dataset.
How it connects
Connects labels to targets, classes, loss, classification, regression, and generalization.

Also explained in

Compare how 21 books explain label →

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.