Solved – Plotting QDA projections in R

discriminant analysisr

When doing discriminant analysis using LDA or PCA it is straightforward to plot the projections of the data points by using the two strongest factors.

This can be done in R by using the x component of the pca object or the x component of the prediction lda object.

My question is: Is it possible to project points in 2D using the QDA transformation?

If yes, how would we do this in R and ggplot2?

Best Answer

The only tool I found so far is partimat from klaR package. It's not the same as plotting projections in PCA or LDA. But it can give you an idea about the separating surface.

Example:

library(klaR)
partimat(Species ~ ., data = iris, method = "qda", plot.matrix = TRUE, col.correct='green', col.wrong='red')

enter image description here