liveBook · Manning

Binary variable

Also called binary feature

A binary variable is a variable that can take exactly two possible values or categories.

How 3 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 variable →

Fight Fraud with Machine Learning

A binary feature is an input variable whose value is restricted to two alternatives, represented here as 0 and 1.

How it is used
Supports phishing-rule design by serving as directly or inversely interpreted fraud indicators.
How deep it goes
Defines 0/1 inputs, shows detection and correlation analysis, then builds and evaluates logical rules from them.
Examples
Uses NoHttps, RightClickDisabled, FrequentDomainNameMismatch, and SubmitInfoToEmail in a phishing webpage dataset.
What you can do after
Apply it via pandas, Seaborn, and scikit-learn to rank indicators, inspect correlations, and evaluate fraud rules.

Read how Fight Fraud with Machine Learning explains binary variable →

Effective Data Analysis

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

How it is used
Uses a 0/1 weekday indicator as a predictor when exploring a model of daily New York City rat sightings.
How deep it goes
Defines binary coding, contrasts a single weekday indicator with dummy-coded days, and checks correlations without detailing model fitting.
Examples
Illustrates a weekday indicator for rat-sighting data and compares its correlations with weather predictors and sightings.
What you can do after
Apply via pandas to derive a weekday indicator and inspect its correlations with rat sightings and weather predictors.

Read how Effective Data Analysis explains binary variable →

Also covered in

What to know first

Related concepts

Questions about binary variable

What is binary variable?

A binary variable is a variable that can take exactly two possible values or categories.

Which Manning books explain binary variable?

Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI, Fight Fraud with Machine Learning and Effective Data Analysis.

What should I know before learning binary variable?

Manning books that teach binary variable usually introduce accuracy and correlation first.

What is the difference between binary variable and categorical data?

A binary variable is a variable that can take exactly two possible values or categories. Categorical data consists of values representing membership in discrete categories rather than measured numerical magnitudes.

What kinds of binary variable are there?

Kinds of binary variable include missing data indicator.

What is binary variable a kind of?

Binary variable is a kind of input. An input is information, a value, or an action supplied to a system, program, or computation for processing or to influence its behavior.

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.