Hello! In our last lesson, we distinguished between features (the inputs) and labels (the outputs) that we use to train a machine learning model. Now, we'll zoom in and look at the actual data itself. Just like in programming, where you have different data types like integers, strings, and booleans, machine learning also has its own way of classifying data.
Today, our goal is to identify the three common data types used in machine learning: numerical, categorical, and text. Understanding these types is crucial because the type of data you have determines the tools and techniques you'll need to use to prepare it for a model.
The Big Picture: How Data is Organized
At a high level, almost all data you'll encounter in ML can be sorted into a few key groups. The most common distinction is between data made of numbers and data made of words or groups.
The flowchart below gives you a great visual map of the main data types. We will explore each of these branches.

As you can see, the two main branches are Numerical and Categorical data. We will also discuss a third important type, Text data.
1. Numerical Data: The World of Numbers
Numerical data is probably the most straightforward type. It's any data that is represented by numbers and has a mathematical meaning. Think of things you can measure or count. This type is often called "quantitative data."
Numerical data itself comes in two flavors:
- Continuous Data: This data can take any value within a given range. Think of measuring someone's height. It could be 175cm, 175.1cm, or even 175.112cm. The number of possible values is infinite. Other examples include temperature, weight, and time.
- Discrete Data: This data can only take on specific, separate values. It's often things you can count. For example, the number of bedrooms in a house can be 2, 3, or 4, but it can't be 2.5. Other examples include the number of cars in a parking lot or a student's score on a test (if it's in whole numbers).
The image below shows this distinction clearly with some practical examples.

To get a very clear and intuitive explanation of this concept, the following video is excellent. It uses simple examples like weight (continuous) and the number of children (discrete) to make the difference easy to remember.
Types of Data: Categorical vs Numerical Data
This video from 365 Data Science provides a great breakdown of numerical data into its discrete and continuous forms.
Please watch the section from the beginning of the numerical data explanation up to the end of the summary. Pay close attention to the contrast between weight and the number of children.
2. Categorical Data: The World of Groups
Categorical data describes qualities or characteristics. It places data points into groups or categories. Think of car brands ("Ford", "Toyota", "BMW") or a simple yes/no answer.
A key point here is that categorical data can sometimes be represented by numbers. For example, you might represent "Yes" as 1 and "No" as 0. However, unlike numerical data, these numbers have no mathematical meaning. It makes no sense to calculate the average of 1 and 0 in this context.
In programming terms, you can think of categorical data as being similar to an enum (enumerated type), where you have a fixed set of named values.
3. Text Data: The World of Words
The third major data type is text. This is exactly what it sounds like: free-form text such as customer reviews, emails, tweets, or news articles.
Machine learning models can't work with raw text directly; they only understand numbers. A huge and fascinating part of machine learning, called Natural Language Processing (NLP), is dedicated to turning text data into numerical features that a model can learn from. We'll touch on how this is done later in the course.
To solidify these definitions, the following reading provides short, clear explanations for each data type.
Chapter 2 - Data Fundamentals — Machine Learning for Dummies
This resource from "Machine Learning for Dummies" gives a very simple and direct explanation of the basic data types.
Please read the sections on Numerical Data, Categorical Data, and Text Data. Don't worry about the "Binary" or "Time Series" sections for now; they are special cases of the main types we've discussed.
Let's Put It All Together
Let's revisit our house price prediction example from the last lesson. The features were the size, number of bedrooms, and zip code, and the label was the price. Let's classify each one:
- Size (in square feet): This is a measurement that can take any value in a range (e.g., 1500.5 sq ft). This is Numerical (Continuous).
- Number of bedrooms: This is a count of whole items. It can be 2 or 3, but not 2.5. This is Numerical (Discrete).
- Price: This is the value we want to predict. It can be $250,000 or $250,000.75. This is also Numerical (Continuous).
- Zip Code: This one is a bit tricky. It's made of numbers (e.g., 90210), but does it have a mathematical meaning? Does it make sense to calculate the average of two zip codes? No. A zip code represents a geographical area—a group or category. Therefore, a zip code is actually Categorical Data, even though it looks like a number.
This last point is very important. Just because a feature consists of numbers doesn't automatically make it numerical data. You always have to ask: Can I do meaningful math with this number? If not, it's likely categorical.
Conclusion
Great work! You can now identify the fundamental building blocks of any dataset. This skill is the first step toward knowing how to properly handle and prepare data for an ML model.
Here are the key takeaways:
- Numerical Data represents quantities you can measure or count. It can be continuous (infinite values in a range) or discrete (specific, countable values).
- Categorical Data represents groups or labels, like "red," "green," "blue" or "yes/no."
- Text Data consists of words and sentences, which require special processing to be converted into numbers for ML models.
- Always ask if a number has a true mathematical meaning to distinguish between numerical and categorical data.
In our next lesson, we will begin our journey into data cleaning. Now that we understand our data's structure and type, we'll learn how to deal with one of the most common problems you'll face in any real-world dataset: missing values.