liveBook · Manning

Label

As explained in Vibe Engineering

A label is the target value associated with an example that a supervised machine-learning model learns to predict or uses for evaluation.

A model can appear useful without demonstrating how well it predicts unseen answers. A label is the target value a supervised model learns to predict; held-out labels also provide answers against which to evaluate its predictions. section 4.5.1 section 4.5.2

Keep the label separate from the input features. Conventionally, X contains the feature columns and y contains the label column. Their rows must remain aligned: X[index] and y[index] must describe the same example. section 4.5.1

Table 4.3 Difference between X and Y datasets
Term
Traditional Name
Math Symbol
Shape
Description
Features
Independent Variables
X
Matrix (N rows * M columns)
The "clues" (Dosage, Salt Name, etc.)
Label
Dependent Variable
y
Vector (N rows * 1 column)
The "answer" you want (Price)

Compare the shapes and roles of the feature matrix and label vector. section 4.5.1

Predicting drug prices

Use dosage, salt name, manufacturer, and related fields as features; use price as the label. Shuffle and split the rows into training and test sets, keeping each feature row paired with its price. After training, predict prices from the test features and compare them with the held-out prices. section 4.5.1 section 4.5.2

Classifying risk

A risk label can instead be a category: high risk is encoded as 1 and low risk as 0. High risk is defined by SERIOUS or LIFE-THREATENING values in the side_effects column; drug descriptions are transformed into vectors for prediction. Precision and recall expose the tradeoff between prioritizing safety and avoiding false alarms. section 4.6.1 section 4.7

Check what the labels represent before trusting an evaluation. Synthetic datasets can be useful for testing workflows, but may lack ground truth reflecting real market distributions and can yield unrealistically accurate results. section 4.1

How Vibe Engineering covers it

How deep it goes
Explains feature-label alignment, target construction, and held-out evaluation through drug prediction tasks.
Examples
Illustrates price prediction from drug attributes and risk classification from drug descriptions.
What you can do after
Evaluate predictions by comparing them with held-out labels and considering classification tradeoffs.
How it connects
Connects labels to features, train/test splits, classification, precision, and recall.

Also explained in

Compare how 29 books explain label →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Vibe Engineering. The section links point to the parts of the book it draws on.