liveBook · Manning

Binary feature

A binary feature is an input variable whose value is restricted to exactly two alternatives.

How 2 Manning books explain it

Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI

A binary feature is an input feature whose value has two possible states, such as indicating whether another value is missing.

How it is used
Represents the presence or absence of a quality in tabular data, including patterns conveyed by missing values.
How deep it goes
Defines binary variables and demonstrates pandas-based text flags, while referring readers to MissingIndicator for missingness processing details.
Examples
Uses Airbnb listing names to flag new listings, studios, shared baths, and half-baths, plus missing cases from joins and census responses.
What you can do after
Apply it via pandas string checks or Scikit-learn MissingIndicator to create presence and missingness flags.

Read how Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI explains binary feature →

Effective Data Analysis

A binary variable is a variable with exactly two possible categories or values.

How it is used
Represents a meaningful two-way distinction as a model feature for actionable prediction.
How deep it goes
Explains encoding, dummy-variable alternatives, correlation checks, and complexity tradeoffs, but stops short of model fitting.
Examples
Uses New York City rat sightings, day-of-week indicators, and a weekday variable encoded as 0 or 1.
What you can do after
Build it from scratch by encoding a two-category condition and evaluating its relationship with an outcome.

Read how Effective Data Analysis explains binary feature →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.