liveBook · Manning

Label

As explained in Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI

A numeric output variable to be predicted in a regression problem.

A regression label is the numeric output a model is trained to predict. It is also called the target or target variable. Predictors, or features, are the input columns mapped to that output; locate the target before expanding the predictor set. section 2.3 section 4.2

In an Airbnb dataset, price is a regression label because it is continuous and positive. The same values can be transformed into a classification target by splitting at the mean or median, or by binning into deciles; then the output becomes a class or label rather than a raw numeric value. section 4.2 section 2.3

Prepare a regression label as part of an end-to-end tabular workflow:

  • Keep the target out of the training features; using price as an input would reveal the answer being predicted. section 3.1.4
  • Align the predictor table X and target series y on the same listing index after joining and reordering data. section 7.1.4
  • Inspect its minimum, average, maximum, and percentiles for extreme values and skew before modeling. section 7.1.6
  • If justified, filter both X and y with the same Boolean selection so retained rows remain aligned. section 7.1.6

Predicting mean listing price

A prepared Airbnb table uses listing attributes and engineered location features as X, while y is the mean-price column. Linear regression fits numeric feature weights to make predictions that approximate the target values; missing values, outliers, and weak linear relationships require attention. section 7.1.4 section 4.3.1

Listing 7.10 Plotting the target distribution
import matplotlib.pyplot as plt
import seaborn as sns
 
valid_y = y[valid_samples]                                    #1
sns.kdeplot(valid_y, fill=True)
 
median = np.median(valid_y)                                   #2
plt.axvline(median, color='r', linestyle='--', linewidth=2, label='Median')
 
plt.xlabel('Values')
plt.ylabel('Density')
plt.title('Distribution Curve with Median')
plt.legend()
plt.show()

Use the density plot to inspect the filtered target distribution and its median after selecting the central range of values. section 7.1.6

How Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI covers it

How deep it goes
Explains target selection, assembly, distribution checks, filtering, and linear-regression fitting rather than regression internals beyond coefficients.
Examples
Uses Airbnb price and mean listing price, percentile summaries, Boolean filtering, and a density plot.
What it assumes
Assumes a defined prediction goal and tabular columns while teaching the distinction between target outputs and predictor inputs.
What you can do after
Apply it via pandas-style X and y construction, target inspection, and aligned sample filtering for regression.
How it connects
Connects regression to predictors, features, classification targets, exploratory data analysis, outliers, and linear regression.

Also explained in

Compare how 20 books explain label →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI. The section links point to the parts of the book it draws on.