Description: Standardization: Refers to transforming the data to have a mean of 0 and a standard deviation of 1. This technique is particularly useful when the data follows a Gaussian (normal) distribution.
Normalization: Refers to transforming the data to a fixed range, typically between 0 and 1, and is useful when the data is not normally distributed.
Step-by-Step Process
Import Necessary Libraries: Use scikit-learn for preprocessing and numpy for array manipulations.
Standardization: Subtract the mean of each feature and divide by the standard deviation.
Normalization: Scale the features using the minimum and maximum values of each feature to a fixed range, typically [0, 1].
Apply to Dataset: Standardization and normalization can be applied to each feature of a dataset independently.
Sample Source Code
# Code for Standardization and Normalization
import numpy as np
import pandas as pd
from sklearn.preprocessing import StandardScaler, MinMaxScaler