0% found this document useful (0 votes)
32 views

Lecture 2.3 Data Normalization

Feature normalization is a preprocessing step essential for ensuring that features with different scales contribute equally in machine learning algorithms, particularly those that compute distances. Two common methods for normalization are min-max scaling, which rescales features to a range of [0, 1], and standardization, which involves subtracting the mean and dividing by the standard deviation. It is important to note that the output or target variable should not be rescaled or standardized.

Uploaded by

homerajasekhar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

Lecture 2.3 Data Normalization

Feature normalization is a preprocessing step essential for ensuring that features with different scales contribute equally in machine learning algorithms, particularly those that compute distances. Two common methods for normalization are min-max scaling, which rescales features to a range of [0, 1], and standardization, which involves subtracting the mean and dividing by the standard deviation. It is important to note that the output or target variable should not be rescaled or standardized.

Uploaded by

homerajasekhar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Note about Normalization

Features Normalization
• Feature normalization is a preprocessing step used to normalize the range
of the features.

• It is important when the features have very different scales.


– For example, if the values of feature 𝟏𝟏 are ∈ [0, 1] but the values of feature 𝟐𝟐
are ∈ [120, 190], then normalizing the features is important.

• Motivation:
– Suppose that some ML algorithm computes the Euclidean distance between two
points. If one of the features has a broad range of values, the distance will be
governed by this particular feature. Therefore, the range of all features should be
normalized so that each feature contributes approximately proportionately to
the final distance.

0.11 0.52
− = 3.027
182 179

2
min-max Features scaling

𝑣𝑣𝑗𝑗 − min(𝑣𝑣𝑗𝑗 )
𝑣𝑣𝑣𝑗𝑗 =
max 𝑣𝑣𝑗𝑗 − min(𝑣𝑣𝑗𝑗 )

• 𝑣𝑣𝑗𝑗 is a column (corresponding to feature 𝑗𝑗) from the data matrix 𝑋𝑋.
• 𝑣𝑣′𝑗𝑗 are the normalized values of feature 𝑗𝑗. These values will be ∈ [0, 1]

3
min-max Features scaling
• Before Features Scaling • After Features Scaling

4
Features Standardization

𝑣𝑣𝑗𝑗 − mean(𝑣𝑣𝑗𝑗 )
𝑣𝑣𝑣𝑗𝑗 =
stdev 𝑣𝑣𝑗𝑗

• 𝑣𝑣𝑗𝑗 is a column (corresponding to feature 𝑗𝑗) from the data matrix 𝑋𝑋.
• 𝑣𝑣′𝑗𝑗 are the normalized values of feature 𝑗𝑗. These values will be ∈ [0, 1].
• To normalize, we just subtract the mean and divide by the standard deviation.

5
Features Standardization
• Before • After

6
• NOTE: do not rescale or standardize the output (target variable).

𝑣𝑣𝑗𝑗 − min(𝑣𝑣𝑗𝑗 )
𝑣𝑣𝑣𝑗𝑗 =
max 𝑣𝑣𝑗𝑗 − min(𝑣𝑣𝑗𝑗 )
𝑣𝑣𝑗𝑗 − mean(𝑣𝑣𝑗𝑗 )
𝑣𝑣𝑣𝑗𝑗 =
stdev 𝑣𝑣𝑗𝑗

You might also like