Member-only story
Do we need feature scaling before Linear Discriminant Analysis (LDA)?
LDA for dimensionality reduction with and without feature scaling
Linear discriminant analysis (hereafter, LDA) can be used for linear dimensionality reduction.
In most cases, it is necessary to do feature scaling before Principal Components Analysis — PCA, which is another linear dimensionality reduction technique.
Does the same apply for LDA?
This is a question that most beginners have in their minds.
In this article, we will visually answer this short question by performing LDA on Wine data with and without feature scaling. We will compare the outputs on both occasions.
The features of the Wine dataset were measured on completely different scales. So, this dataset is ideal for doing this type of experiment.
Acquire Wine data
The Wine dataset comes preloaded with Scikit-learn. We can use the load_wine() function to load the dataset. A part of the dataset is shown below.
import pandas as pd
from sklearn.datasets import load_wine
wine = load_wine()
X = wine.data
y = wine.target
df = pd.DataFrame(wine.data, columns=wine.feature_names)
df.head()