A class label identifies the categorical outcome assigned to an observation. In supervised classification, known labels are used to train a model; the fitted model then predicts labels for observations whose outcomes are unknown. A label may be represented by a number without becoming a quantitative response: a 0 or 1 can identify a category rather than a measured amount. Linear regression predicts numeric responses, so it is not the method to use when the desired outcome is a class label. section 4.0 section 4.1
Define the label to match the decision the model must make. For a fourth-down football play, CONVERT is 0 when YARDS_GAINED is less than TO_GO and 1 otherwise. Those values mean failure and success, respectively. YARDS_GAINED alone could instead be a numeric regression target, but combining it with TO_GO creates the binary target needed for the conversion classification task. Encoded input categories, such as play type, remain predictors; their 0 and 1 values are not the CONVERT labels. section 6.2.2 section 6.3.1
>>> nfl_pbp['CONVERT'] = np.where(nfl_pbp['YARDS_GAINED'] < \ >>> nfl_pbp['TO_GO'], 0, 1)
The NumPy assignment makes the labeling rule explicit: compare yards gained with yards needed, then store the resulting failure or success class in CONVERT. section 6.2.2
For model fitting, place the predictors in X and the observed labels in y, then split both into training and test sets. A decision tree learns from the training set; `clf.predict(X_test)` returns predicted labels for the held-out observations. Compare those predictions with the corresponding actual labels to assess predictive performance on unseen data. Within the tree, feature-based branches lead to leaf nodes that supply the final class predictions. section 6.3.1 section 6.3.3 section 6.3.6
Labels also appear as the dependent variable in logistic regression. For example, Class records raisin variety while morphological measurements serve as predictors. The practical distinction is the same across these classifiers: identify the category to predict, keep it separate from the features used to predict it, and evaluate predictions against observed labels. section 5.2.2 section 6.3.1



















