How to implement Quadratic Discriminant Analysis in R ?

Description

To implement Quadratic Discriminant Analysis in R

Libraries required :

require(MASS)
library(caret)

  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

Leave Comment

Your email address will not be published. Required fields are marked *

clear formSubmit