Now, let's look at the various methods we can use for feature scaling:
- Standard Scaling or Z-Score Normalization: This method computes the scaled values of a feature by using the mean and standard deviation of that feature. It is best suited for normally distributed data. Suppose
is the mean and
is the standard deviation of the feature column. This results in the following formula:
Let's take a look at the following standard scaling example:
# Import StandardScaler(or z-score normalization)
from sklearn.preprocessing import StandardScaler
# Initialize the StandardScaler
scaler = StandardScaler()
# To scale data
scaler.fit(data['performance_score'].values.reshape...