Question: 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 150 samples (rows) and 5 variables (columns) named Sepal.Length, Sepal.Width, Petal.Length, Petal.Width, and Species.
(a)(1 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)(1 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)(1 point (0.5+0.5)+0.5 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)(1 point) Create the plot in (b) and add the LDA line that discriminates between the two classes.
### Your Solution (Code)
(e)(2 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? (help(predict))
### Your Solution (Code)
 Using R, we now perform LDA on a subset of the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!