Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using R , we now perform LDA on a subset of the iris dataset which we have already covered in the lecture. The iris data
Using R we now perform LDA on a subset of the iris dataset which we have already covered in the lecture. The iris data set is a data frame with samples rows and variables columns named Sepal.Length, Sepal.Width, Petal.Length, Petal.Width, and Species.
a point Create a subset of the iris data frame, where the rows for the species virginica and the columns Sepal.Length and Petal.Width are excluded.
### Your Solution Code
b point Create a scatter plot, where Petal.Length is plotted against Sepal.Width, and where each dot is colored by its corresponding species.
### Your Solution Code
c point Bonus points Perform LDA using the created subset, and print the fitted model. Please explain the values of Prior probabilities of groups, Group means, Coefficients of linear discriminants. Hint: The package MASS is required for the lda function
### Your Solution Code
d point Create the plot in b and add the LDA line that discriminates between the two classes.
### Your Solution Code
e points Obtain the predicted class using the fitted model on the created training dataset. Further, print the confusion matrix. What is the train accuracy for this classifier? helppredict
### Your Solution Code
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started