Categorical data
Categorical data consists of values representing membership in a discrete set of named or ordered categories rather than measured numerical magnitudes.
Statistics Slam Dunk
A categorical variable records observations as membership in one of a finite set of qualitative categories.
- How it is used
- Organizes NBA observations into groups for visualization, summaries, segmentation, and statistical analysis.
- How deep it goes
- Defines fixed-value variables, demonstrates conversion and recoding, and applies factors in grouped analyses without detailing factor internals.
- Examples
- Uses draft year, teams, player positions, birth region, draft segments, play events, free throws, and standardized scoring categories.
- What you can do after
- Apply it via base R functions to convert, inspect, recode, group, and visualize fixed-set variables as factors.
The Well-Grounded Data Analyst
Categorical data consists of values representing membership in discrete, named groups or categories.
- How it is used
- Guides analysis of survey, operational, and hierarchy fields whose values represent discrete groups rather than measurements.
- How deep it goes
- Defines nominal and ordinal categories, then develops inspection, encoding, cross-tabulation, binning, visualization, and statistical-test choices without deriving the tests.
- Examples
- Uses heart-disease slope codes, cinema COVID periods and genres, and a developer survey about AI tools.
- What you can do after
- Apply it by inspecting categories, preserving ordinal order, encoding model inputs, and comparing groups with appropriate tables, plots, and tests.
Read how The Well-Grounded Data Analyst explains categorical data →
Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI
An input variable whose values represent membership in discrete categories rather than continuous quantities.
- How it is used
- Classifies tabular columns so they receive processing appropriate to discrete labels rather than continuous measurements.
- How deep it goes
- Explains identification through samples and distinct-value counts, then introduces one-hot encoding and embeddings without implementation details.
- Examples
- Uses currency attributes, Auto MPG origin and cylinders, and Kuala Lumpur property location, type, furnishing, and numeric-looking fields.
- What you can do after
- Evaluate/understand whether a column is categorical and select one-hot encoding or embeddings as possible transformations.
Grokking Machine Learning
Data whose values belong to a finite set of named categories or states.
- How it is used
- Distinguishes supervised-learning labels that predict categories from numerical labels and identifies categorical input features for preprocessing.
- How deep it goes
- Defines finite categories and names one-hot encoding and binning as ways to convert between categorical and numerical representations.
- Examples
- Uses animal types, spam or ham labels, gender, and passenger embarkation ports as examples.
- What you can do after
- Apply one-hot encoding to categorical features or bin numerical features into categories before model training.
Read how Grokking Machine Learning explains categorical data →
Data Without Labels
A categorical variable records membership in one of a set of qualitative categories rather than a numeric magnitude.
- How it is used
- Identifies qualitative inputs that may need conversion for clustering and categorical outcomes predicted by classification.
- How deep it goes
- Defines binary, nominal, and ordinal types, then demonstrates numeric conversion and warns about sparse columns and low-value fields.
- Examples
- Uses city indicator columns, low-variation city and zip-code fields, and edible-or-poisonous mushroom classes.
- What you can do after
- Apply it via pandas get_dummies() or scikit-learn LabelEncoder, while checking whether category counts and variation make a field useful.
Outlier Detection in Python
Categorical data consists of values drawn from discrete categories rather than measured on a continuous numerical scale.
- How it is used
- Uses category frequencies, combinations, and categorical clustering to identify potentially unusual tabular rows.
- How deep it goes
- Works through count-based detection, combination counts, detector preparation, and a KModes scoring example, while cautioning against automatic interpretations of rarity.
- Examples
- Uses staff expenses, categorical combinations in eucalyptus data, and synthetic KModes rows with an inserted outlier.
- What you can do after
- Apply it via category counts or KModes to flag unusual values, combinations, or cluster-center mismatches for review.
Read how Outlier Detection in Python explains categorical data →
Ensemble Methods for Machine Learning
A categorical variable is an input variable whose values belong to a finite set of discrete categories.
- How it is used
- Uses categorical inputs in machine-learning models after choosing encodings that reflect their underlying structure.
- How deep it goes
- Defines nominal and ordinal categories, motivates encoding, and contrasts preprocessing with direct categorical boosting.
- Examples
- Uses T-shirt color and size, demographic income prediction, ZIP codes, and weather categories as concrete examples.
- What you can do after
- Apply it by distinguishing category types and selecting preprocessing or categorical-aware ensemble tooling.
Read how Ensemble Methods for Machine Learning explains categorical data →
Effective Data Analysis
A categorical variable is a variable whose values represent membership in distinct categories rather than measured numerical amounts.
- How it is used
- Represents group membership for predictive modeling, feature derivation, and comparisons between observed and expected frequencies.
- How deep it goes
- Explains dummy coding, omitted reference categories, binary regrouping, visual checks, and chi-square testing, but not model internals.
- Examples
- Uses day-of-week categories, rat-sighting boxplots, dummy-coded predictors, and a weekday indicator in a weather dataset.
- What you can do after
- Apply it via dummy coding, binary regrouping, visualization, correlation checks, and chi-square comparisons.
Read how Effective Data Analysis explains categorical data →
Deep Learning with PyTorch, Second Edition
A variable type whose values are treated as discrete labels rather than ordered magnitudes.
- How it is used
- Distinguishes label-like values from continuous and ordinal values, then guides representations for learning tasks.
- How deep it goes
- Defines categorical values by contrast, then works through one-hot outputs and learned embedding alternatives.
- Examples
- Uses airplane-versus-bird labels, CIFAR-10 classes, text vocabularies, and recommender-system items.
- What you can do after
- Apply it via one-hot encoding or embeddings when preparing categorical inputs and classifier targets.
Read how Deep Learning with PyTorch, Second Edition explains categorical data →
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.
- How it is used
- Supports data surveys by revealing category coverage, distributions, unexpected values, and questions for exploratory-data-analysis follow-up.
- 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 you can do after
- Evaluate category distributions and produce prioritized exploratory-data-analysis questions for deeper investigation.
Read how Delivering Machine Learning Projects: From design to deployment explains categorical data →
Grokking AI Algorithms, Second Edition
Categorical data consists of values representing membership in discrete named or ordered categories.
- How it is used
- Supports classification and prepares named or ordered values for numerical modeling.
- How deep it goes
- Defines categorical features, contrasts them with continuous values, and explains encoding and missing-value choices.
- Examples
- Uses diamond Cut, Color, Clarity, and Origin plus vehicle, animal, and device classes as concrete examples.
- What you can do after
- Apply one-hot or label encoding appropriately and choose reasonable treatments for missing categorical values.
Read how Grokking AI Algorithms, Second Edition explains categorical data →
Everyday Data Visualization
Data whose values represent categories for which the ordering of values is not inherently meaningful.
- How it is used
- Distinguishes categorical from sequential values to guide visualization choices.
- How deep it goes
- Defines categorical values, contrasts their ordering with sequential data, and gives visual encoding guidance without implementation internals.
- Examples
- Uses sales regions, bike-rental thresholds, fruit data, funnel steps, pain scales, generations, and survey responses as examples.
- What you can do after
- Evaluate categorical encodings and apply color with an additional visual cue when designing data displays.
Read how Everyday Data Visualization explains categorical data →
Math and Architectures of Deep Learning
A variable that takes one value from a finite set of categories rather than a continuum of real values.
- How it is used
- Distinguishes finite-valued targets from continuous quantities and frames categorical outputs as classification problems.
- How deep it goes
- Defines categories, binary variables, classifier mappings, and decision-boundary geometry, but does not develop implementation code.
- Examples
- Uses stock-selling advice, face detection, image vectors, cat-threat classification, and sampled class regions.
- What you can do after
- Evaluate/understand whether a target is categorical and interpret its classifier output as a class or region in input space.
Read how Math and Architectures of Deep Learning explains categorical data →
Deep Learning with Python, Third Edition
Data whose values belong to discrete categories rather than a continuous numeric scale.
- How it is used
- Uses discrete feature values to choose representations, model architectures, and classification output configurations.
- How deep it goes
- Explains category vectors, order-sensitive alternatives, dense-network use, output activations, target encodings, and losses.
- Examples
- Uses tokens, bag-of-words text, the Boston Housing Price dataset, and Keras classification configurations as concrete examples.
- What you can do after
- Apply categorical representations and select activations, target encodings, losses, and network types for classification tasks.
Read how Deep Learning with Python, Third Edition explains categorical data →
Statistics Every Programmer Needs
A categorical variable is a variable whose values represent membership in distinct qualitative classes or categories.
- How it is used
- Uses qualitative classes for descriptive summaries, comparisons, and conditional-probability calculations.
- How deep it goes
- Defines classes and counts, then works through contingency tables and conditional probabilities without extending into advanced modeling.
- Examples
- Uses symptoms and medical-test results, represented as labeled rows, columns, and frequency-count cells.
- What you can do after
- Apply it via pandas by constructing contingency tables and calculating category-specific proportions.
Read how Statistics Every Programmer Needs explains categorical data →
Causal AI
A categorical variable is a variable whose values are labels from a finite set of categories rather than numerical measurements.
- How it is used
- Supports fitting causal graphical models when variables take discrete labeled values.
- How deep it goes
- Connects categorical variables to learned conditional probability tables and explains lookup probabilities, but does not develop encoding methods.
- Examples
- Uses transportation survey responses and car, train, or other choices conditioned on occupation and residence.
- What you can do after
- Apply it via pgmpy by fitting a Bayesian network and inspecting its learned conditional probability tables.
Related concepts
- classifierproduced by · A classifier is a predictive computational model that assigns inputs to one or more discrete classes or categories.
- one-hot encodingused by · One-hot encoding represents each category as a binary vector or set of indicators with exactly one active component identifying that category.
- chi-square testused by · A chi-square test is a statistical hypothesis test that uses a chi-square-distributed statistic to evaluate hypotheses about categorical data, goodness of fit, or variance.
- discrete variableequivalent to · A discrete variable is a variable whose possible values belong to a finite or countable set of distinct alternatives rather than a continuous range.
- ordinal dataincludes · Ordinal data consists of categorical values with a meaningful order or rank, without necessarily having equal intervals between categories.
- nominal dataincludes · Nominal data consists of categorical values whose labels have no inherent or meaningful ordering.
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.















