MACHINE LEARNING • LESSON 5

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.

THE SIMPLEST DEFINITION

Numerical features tell us "how much" or "how many."

If a feature represents a measurable quantity or count, it is usually a numerical feature.

01

What Is a Numerical Feature?

A numerical feature is a feature whose value is represented using numbers.

AGE 29

How old is the customer?

PRICE $500,000

How much does the house cost?

BEDROOMS 3

How many bedrooms?

HEIGHT 175 cm

How tall is the person?

02

Simple House Example

Suppose we want to predict the price of a house.

FEATURE Size

2,000 sq ft

FEATURE Bedrooms

3

FEATURE Age

8 years

LABEL Price

$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.

03

Numerical Features Can Be Different Types of Numbers

Numerical features do not have to be whole numbers. They can also contain decimal values.

WHOLE NUMBER 25

Age in years

DECIMAL NUMBER 72.5

Weight in kilograms

LARGE NUMBER 500000

House price

All of these are numerical values and can be used as numerical features.

04

Count vs Measurement

Numerical features commonly represent either a count or a measurement.

COUNT Previous Purchases = 8

Counts how many purchases happened.

MEASUREMENT Height = 175 cm

Measures the person's height.

Both are numerical features because both are represented by meaningful numerical values.

05

Numerical Features in a Dataset

Consider this customer dataset:

Age Purchases Income Purchased
29 5 60000 Yes
35 2 45000 No
24 8 75000 Yes

Age, Purchases, and Income are numerical features.

Purchased is the label for this particular prediction problem.

06

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.

INPUT House Size

1,500 sq ft

INPUT House Size

2,000 sq ft

PATTERN Larger houses may have higher prices

The model can use numerical information to learn relationships and patterns in the training data.

07

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:

CUSTOMER ID 48392
CUSTOMER ID 91827
CUSTOMER ID 27164

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.

08

Numerical vs Categorical Features

Now compare numerical features with categorical features.

NUMERICAL Age = 29

Represents a measurable quantity.

CATEGORICAL City = Mumbai

Represents a category or group.

A simple way to remember the difference is:

Numerical → "How much?" or "How many?" Categorical → "Which type?" or "Which group?"
REMEMBER THIS

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.

QUICK CHECK

Which Ones Are Numerical Features?

Age = 30 Numerical
Height = 175 cm Numerical
City = Hyderabad Categorical
Answer

Age and height are numerical because they represent measurable quantities. City is categorical because it represents a group or category.

NEXT TOPIC

Categorical Features

Not all useful information is a number. Next, we will learn about categorical features such as city, product type, membership, and payment method.