To implement Quadratic Discriminant Analysis in R
Load the necessary libraries
Load the data set
Perform a principal component analysis on the data
Take the summary
Visualize the result
#load the required libraries
require(MASS)
library(caret)
library(tidyverse)
library(klaR)
#Load the data set
data=read.csv(‘/……./iris.csv’)
#Perform linear discriminant analysis
qda_model <-qda(species~.,data)
#Take the summary
summary(qda_model)
qda_model$prior
qda_model$counts
qda_model$means
qda_model$scaling
qda_model$ldet
qda_model$lev