liveBook · Manning

Categorical data

As explained in Delivering Machine Learning Projects: From design to deployment

Categorical data is data whose values belong to a finite set of discrete categories rather than representing continuous quantities.

Categorical data contains labels assigned to things rather than measured quantities, such as colors, species, textures, product identifiers, or sensor types. Survey it to establish category coverage, distribution, and issues requiring deeper analysis. section 5.2.1 section 5.2.3

Turn a categorical-data check into explicit survey work:

  • Enumerate distinct category values so the data’s vocabulary and unexpected labels become visible. section 5.2.3
  • Count records across categories to identify distributions and decide whether the category set is small enough to inspect directly. section 5.2.3
  • Flag values such as UNKNOWN for investigation rather than silently treating them as ordinary categories. section 5.2.3
  • Convert important questions into exploratory-data-analysis follow-up items, while stopping the survey before committing to detailed scrutiny. section 5.2.3

Surveying sensor types

For a smart-building temperature_readings table, count distinct sensor_type values before examining their behavior. A result of 7 justifies enumerating A1, A2, Tp, Tn, Tx, Xr, and UNKNOWN, then asking how each type affects readings, ranges, outliers, quality, and measurement granularity. section 5.2.3

SELECT Count(*) FROM (SELECT DISTINCT sensor_type FROM temperature_readings);
>7

Inspect the distinct-category count, then pair it with the category listing to decide whether direct enumeration is practical. section 5.2.3

How Delivering Machine Learning Projects: From design to deployment covers it

How deep it goes
Defines categorical fields and gives SQL-based inspection steps, but stops short of investigating category effects in exploratory analysis.
Examples
Uses smart-building sensor types, distinct-value counts, category listings, and the UNKNOWN value as concrete survey artifacts.
What it assumes
Assumes access to database records and basic survey context, while allowing readers who cannot read SQL to follow the investigation.
What you can do after
Evaluate category distributions and produce prioritized exploratory-data-analysis questions for deeper investigation.
How it connects
Connects categorical data with data surveys, exploratory data analysis, numerical data, and unstructured data.

Also explained in

Compare how 16 books explain categorical data →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Delivering Machine Learning Projects: From design to deployment. The section links point to the parts of the book it draws on.