Numerical Features
Numerical features are features represented by numbers. They describe measurable quantities such as age, price, height, weight, distance, or the number of previous purchases.
Numerical features tell us "how much" or "how many."
If a feature represents a measurable quantity or count, it is usually a numerical feature.
What Is a Numerical Feature?
A numerical feature is a feature whose value is represented using numbers.
How old is the customer?
How much does the house cost?
How many bedrooms?
How tall is the person?
Simple House Example
Suppose we want to predict the price of a house.
2,000 sq ft
3
8 years
$400,000
Size, bedrooms, and house age are numerical features because they contain measurable numbers.
Price is the label in this particular problem because it is the value we want the model to predict.
Numerical Features Can Be Different Types of Numbers
Numerical features do not have to be whole numbers. They can also contain decimal values.
Age in years
Weight in kilograms
House price
All of these are numerical values and can be used as numerical features.
Count vs Measurement
Numerical features commonly represent either a count or a measurement.
Counts how many purchases happened.
Measures the person's height.
Both are numerical features because both are represented by meaningful numerical values.
Numerical Features in a Dataset
Consider this customer dataset:
Age, Purchases, and Income are numerical features.
Purchased is the label for this particular prediction problem.
Why Are Numerical Features Important?
Machine learning models need information that they can use to discover patterns.
Numerical features provide measurable information that many machine learning algorithms can work with directly.
1,500 sq ft
2,000 sq ft
The model can use numerical information to learn relationships and patterns in the training data.
Numerical Does Not Automatically Mean Useful
Just because something is represented by a number does not mean it is a useful feature.
For example, suppose every row in a dataset has a randomly generated customer ID:
These are numbers, but the numbers themselves usually do not contain useful information about whether the customer will purchase something.
This is why feature selection matters. A numerical feature still needs to be relevant to the problem.
Numerical vs Categorical Features
Now compare numerical features with categorical features.
Represents a measurable quantity.
Represents a category or group.
A simple way to remember the difference is:
Numerical Features Are Meaningful Numbers.
Age, price, weight, height, distance, quantity, and number of purchases are examples of numerical features. The number should represent a meaningful measurement or count, not simply be a number assigned to an item.
Which Ones Are Numerical Features?
Age and height are numerical because they represent measurable quantities. City is categorical because it represents a group or category.