# Categorical data

> Canonical: https://skillalmanac.com/glossary/categorical-data | Last verified: 2026-11-25 | Index status: index-eligible

Categorical data records membership in named groups or states, such as a ticket type or traffic-light color, rather than measuring an amount.

Also called: categorical feature.

## In plain language

Categorical data represents attributes using a defined set of categories. A model may learn different behavior for each category, but numeric-looking category codes remain labels unless their values genuinely measure or count something.

## Technical definition

A categorical feature takes values representing groups, classes or states. Categories may be unordered or have a meaningful order, but arithmetic differences between their stored codes are not automatically meaningful. Categorical data differs from quantitative measurements and counts, including discrete numeric counts.

## How it shows up when you use agents

Categorical data records which group, type or state an observation belongs to. Examples include a traffic light's state, a support request's topic or an agent run's final status. Each feature has a set of possible values, and a machine-learning model can learn that different values are associated with different outcomes.

Imagine an illustrative support agent whose tickets have a `request_type` field with the categories `billing`, `technical` and `account`. In 300 reviewed tickets, suppose there are 120 billing, 100 technical and 80 account requests. Those counts describe the distribution of categories. An average request type would not be meaningful, even if the database stored the three labels as 1, 2 and 3.

Before training or evaluating a model, list the permitted categories and inspect unexpected spellings, capitalization and missing values. Decide what an unknown or newly introduced category should mean. This prevents values such as `Technical`, `technical` and `tech` from silently becoming separate groups when they were intended to represent the same state.

## Common confusions

Categorical does not mean every value must be stored as text. Blood types or colors may use words, while product classes may use numeric codes. A code such as 3 is still a label if subtracting it from code 5 has no domain meaning.

Conversely, not every discrete numeric variable is categorical. The number of tool calls in an agent run is a quantitative count: differences and arithmetic summaries can be meaningful. Treating every integer column as a category would erase that distinction.

Some categorical variables have an order, such as low, medium and high priority. The order is meaningful, but equal spacing is not guaranteed: the jump from low to medium need not equal the jump from medium to high. Unordered categories, such as ticket topics, have no inherent ranking.

Categorical data also should not be confused with a classification target. A category can be an input feature, an output label or descriptive metadata. Inspect its role and meaning before selecting an encoding or metric.

## Worked examples in this catalogue

### [data-analysis-eda](https://skillalmanac.com/skills/skill-almanac/data-analysis-eda)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Use the CSV profiling workflow to inspect inferred types, distinct values, case variants, zero-padded codes and mixed representations in possible categorical columns.

Why it exercises the concept: These checks can reveal inconsistent category encoding before modeling. The skill uses surface rules, so a domain owner must still decide what each value means and whether a numeric-looking column is a category, count or measurement.

## Related terms

- [Feature engineering](https://skillalmanac.com/glossary/feature-engineering.md)
- [Data labeling](https://skillalmanac.com/glossary/data-labeling.md)
- [Classification](https://skillalmanac.com/glossary/classification.md)
- [Training data](https://skillalmanac.com/glossary/training-data.md)

## Sources

- [Machine Learning Glossary: Categorical data](https://developers.google.com/machine-learning/glossary#categorical-data), Google for Developers (accessed 2026-11-25)
- [1.2 Data, Sampling, and Variation in Data and Sampling](https://openstax.org/books/introductory-statistics-2e/pages/1-2-data-sampling-and-variation-in-data-and-sampling), OpenStax (accessed 2026-11-25)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-25. [Glossary index](https://skillalmanac.com/glossary.md).
