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




























