Types of Data › Core Data Classification Systems
Machine Learning from ScratchAll chapters Types of Data › Core Data Classification SystemsOne section · Sections in this chapter3 / 8 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
One common framework distinguishes quantitative variables, whose values represent numerical measurements or counts, from qualitative variables, whose values represent categories. In the hierarchy used here, quantitative variables can be discrete or continuous, while qualitative variables can be nominal or ordinal. Other texts sometimes use these terms differently, so document the operational meaning of each variable (Australian Bureau of Statistics, 2023a).
These classifications describe different aspects of a variable:
- Quantitative versus qualitative describes what its values represent.
- Discrete versus continuous describes its modeled support.
- Nominal, ordinal, interval, and ratio describe which empirical relations and transformations preserve meaning.
They do not form one universal partition. A count, for example, can be both discrete and ratio-scale, while a continuous measurement may be interval- or ratio-scale (Stevens, 1946; Velleman & Wilkinson, 1993).
The familiar nominal–ordinal–interval–ratio vocabulary was presented in psychologist S. S. Stevens's influential 1946 paper. Paraphrasing N. R. Campbell, Stevens made the rule behind a numerical representation part of the definition:
“[M]easurement, in the broadest sense, is defined as the assignment of numerals to objects or events according to rules.”
The phrase “according to rules” is the important part. It explains why two variables stored as numbers may support different comparisons and operations.
Quantitative vs. Qualitative Data
We begin with the distinction between quantitative (numerical) and qualitative (categorical) data.
Quantitative Data
Quantitative data consists of numerical values that represent measurements or counts. Examples include:
- height in centimeters
- annual income in dollars
- number of defects in a product
These are quantitative variables because their values represent measured amounts or counts. Numeric identifiers and numeric category codes are not quantitative merely because they are stored as numbers (Australian Bureau of Statistics, 2023b).
The operations that are meaningful depend on the measurement scale and context. Means and standard deviations are generally used for interval or ratio variables when their distributions make those summaries informative; medians and quantiles apply more broadly to ordered numerical values.
Qualitative Data
Qualitative data represents categories, labels, or attributes rather than numerical quantities. Category values are often stored as text, but they may also be stored as numeric codes. Examples include:
- a documented gender category
- a product brand or color
- a geographic region
These variables are qualitative when their values identify groups rather than magnitudes (Australian Bureau of Statistics, 2023b).
Arithmetic on category labels or their arbitrary codes is not meaningful: adding two region codes does not produce another interpretable region. Frequencies and proportions are meaningful, and categorical variables can also be used in inferential and predictive models through category-aware methods or suitable encodings.


Discrete vs. Continuous Data
Within the quantitative branch of the hierarchy used here, we can further distinguish between discrete and continuous data.
Discrete Data
Discrete quantitative data takes values from a finite or countably infinite set. Literal counts usually take non-negative whole-number values, but discrete numerical values need not be integers. Common discrete counts include:
- number of students in a classroom
- number of defects in a manufacturing process
- number of cars in a parking lot
Each observation records a count from a discrete set of permitted values (NIST/SEMATECH, n.d.).
Mathematical Definition:
A variable is discrete if it can only take on a finite or countably infinite set of values.
How to read this definition:
- is the random variable representing the data
- A finite set has a specific, limited number of possible values (e.g., )
- A countably infinite set can be put into one-to-one correspondence with the natural numbers (e.g., all non-negative integers )
In plain language, the permitted values can be listed one by one. A finite list eventually stops; a countably infinite list continues without end. The values do not have to be equally spaced or integer-valued.
The possible values of a discrete variable are distinct. For literal counts of indivisible units, values such as 2.5 students or 3.7 defects are not possible, although averages, rates, expected counts, and weighted counts can be fractional. Frequency tables and count models are often useful for discrete data, depending on the question and distribution.
Continuous Data
Continuous measurement data is modeled on a continuum, often an interval of real numbers. Common examples include:
- height
- weight
- temperature
- elapsed time
These quantities are commonly treated as continuous even though instruments record them at finite resolution. The continuum is a model of the underlying quantity, not a claim that a measuring device has unlimited resolution (Polyanskiy, 2018; JCGM, 2012).
Mathematical Definition:
A random variable is absolutely continuous if there is a probability density function such that, for any ,
How to read this equation:
The real numbers and are the left and right endpoints of an interval. The condition simply puts them in that order. On the left, is the probability that the random variable falls between those endpoints. On the right, is a placeholder for values along the horizontal axis, and the integral accumulates the density across the same interval. Geometrically, it is the area under the density curve from to .
The density is nonnegative, and its total area over the real line is 1. A density value at one point is not the probability of that exact value: for an absolutely continuous variable, for every individual . It therefore makes no difference whether the endpoints are written with strict or inclusive inequalities.
The equation also does not say that every interval must have positive probability. If throughout an interval, the integral over that interval is zero. An absolutely continuous distribution can therefore have gaps in its support, and its support may also be unbounded (Polyanskiy, 2018).
For a concrete example, suppose is uniform between 0 and 1, so on that interval. Then
The interval has width 0.3, so the corresponding area is 0.3. The probability is therefore 0.3.
Within any interval used to model possible measurements, infinitely many values lie between two distinct points. For example, the model permits values between 170.0 cm and 170.1 cm even when a particular instrument rounds to the nearest millimeter. This distinction between the underlying quantity and recorded resolution matters when choosing models and interpreting results (JCGM, 2012).

