liveBook · Manning

Label

As explained in Grokking Machine Learning, Second Edition

A designated target outcome or value associated with an example that a supervised-learning model is intended to predict.

A label is the particular feature a supervised-learning model tries to predict. Which feature counts as the label depends on the question: for a pet, it might be the type, health state, or age. section 2.3 section 2.4

Labels can be numerical, such as prices, sizes, weights, or ages, or categorical, such as cat/dog, sick/healthy, or spam/ham. Regression predicts numbers; classification predicts finite categories. section 2.7 section 2.9

Labels connect the dataset to the model’s prediction task:

  • Labeled data includes the target feature; unlabeled data does not include a feature selected for prediction. section 2.6
  • A supervised-learning model learns from labeled examples and predicts the label for new data points. section 2.5 section 2.7
  • Features describe an example and provide the information used to predict its label. section 3.2

One dataset, different labels

For the same pet records, predicting cat or dog makes type the label; predicting sick or healthy makes health the label; predicting age makes age the label. In a housing dataset, the number of rooms can be a feature and the house price the label. section 2.4 section 3.2

Binary labels in practice

An admissions dataset turns a chance of admission of 0.75 or higher into the label “admitted,” and lower chances into “not admitted.” The features include test scores, grades, university ratings, recommendations, and research experience. section 9.12

Figure 2.1 Labeled data is data that comes with a tag, or label. That label can be a type or a number. Unlabeled data is data that comes with no tag. The dataset on the left is labeled, and the label is the type of pet (dog/cat). The dataset in the middle is also labeled, and the label is the weight of the pet (in pounds). The dataset on the right is unlabeled.

Compare labeled pet datasets, where the label is either a category or a number, with an unlabeled image-only dataset. section 2.6

How Grokking Machine Learning, Second Edition covers it

How deep it goes
Defines labels through pet, housing, email, medical, and admissions examples, stopping short of advanced label-generation methods.
Examples
Uses pet types, health states, ages, house prices, spam detection, medical diagnoses, handwritten digits, and admissions decisions.
What it assumes
Assumes basic data features and examples, while teaching from zero how prediction questions determine labels.
What you can do after
Apply it via Scikit-Learn by separating feature columns from labels, fitting a classifier, and predicting labels for rows.
How it connects
Connects labels to features, supervised learning, regression, classification, predictions, labeled data, and unlabeled data.

Also explained in

Compare how 29 books explain label →

Related concepts

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