liveBook · Manning

Binary target

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

A binary target is a prediction target with exactly two possible classes or values.

A binary target is a prediction target with exactly two possible classes or values, commonly encoded as 0 and 1. It turns a continuous business measure, such as listing price, into a classification question. section 4.2.1

Use the target definition to choose an appropriate evaluation strategy:

  • A median-based target can be balanced, making accuracy a reasonable performance measure. section 4.2.1
  • A mean-based target can become imbalanced when the original price distribution is skewed; ROC-AUC or Average Precision is then preferred. section 4.2.1

Creating two price targets

Encode listings above the mean or median price as 1 and the rest as 0. The median split produces 24,423 positive and 24,472 negative cases, while the mean split produces 14,879 positive and 34,016 negative cases.

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

How deep it goes
Defines two construction rules, compares their class distributions, and links imbalance to evaluation metrics.
Examples
Uses mean-price and median-price splits, pandas value counts, and an Airbnb listings price dataset.
What it assumes
Assumes a numeric target and basic pandas operations while demonstrating label creation from mean and median thresholds.
What you can do after
Evaluate binary classifiers with accuracy for balanced labels or ROC-AUC and Average Precision for imbalanced labels.
How it connects
Connects binary targets with classification, class imbalance, accuracy, ROC-AUC, Average Precision, multiclass targets, and regression targets.

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.