I am not sure about plotting a biplot for LDA. Suppose I have a 3 feature data set with 3 classes. Then, I perform LDA to reduce the dimensionality to 2. How can I create a biplot for the LDA?
My understanding of biplot (I may be completely wrong) is simply a projection of the original features in the hyperplane (or line) of the dimensionality reduction. So, for example, using Python
scikit-learn, can I simply perform the following?
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis lda = LinearDiscriminantAnalysis(n_components=2) X_lda = lda.fit_transform(X_std,y) #X_std is input data matrix X standardized by Standardscaler, y is a vector of target values org_features = np.identity(3) proj_features = lda.transform(org_features)
Then, just connect 0,0 to the 3 points in
proj_features to get the 3 arrows corresponding to the 3 original features?
I am still looking for confirmation of the code. For now, I am just interpreting the three points obtained from the product of 3D identity matrix and the LDA projection matrix as the change in location in the 2D LDA plane as I change the value of each feature by 1 Standard Deviation (all features were standardized by StandardScaler) while keeping the rest of the features constant.