liveBook · Manning

Multiclass target

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

A multiclass target is a categorical prediction target with more than two possible classes.

A multiclass target represents a categorical prediction problem with more than two possible classes. Here, five price-based classes support classification rather than regression. section 4.2.1

Turning price into five classes

Create the target by dividing price into five percentile-based groups: target_multiclass = pd.qcut(data["price"], q=5, labels=False). The resulting classes contain 10,063, 9,835, 9,804, 10,809, and 8,384 cases, providing a broadly balanced classification target. section 4.2.1

target_mean = (data["price"] > data["price"].mean()).astype(int)
target_median = (data["price"] > data["price"].median()).astype(int)
target_multiclass = pd.qcut(data["price"], q=5, labels=False)
target_regression = data["price"]

Use the supplied pandas listing to construct multiclass, binary, and regression versions of the same price target. section 4.2.1

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

How deep it goes
Defines and constructs five percentile classes, then checks their counts; stops before model training or evaluation.
Examples
Uses Airbnb price values transformed into five percentile-based classes with pandas qcut.
What you can do after
Apply it via pandas by converting a continuous price column into five categorical classes for classification.
How it connects
Connects multiclass classification with binary targets, regression targets, percentiles, and class-balance checks.

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.