Answered step by step
Verified Expert Solution
Link Copied!

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 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)
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g Database Administrator Implementation And Administration

Authors: Gavin Powell, Carol McCullough Dieter

2nd Edition

1418836656, 9781418836658

More Books

Students also viewed these Databases questions

Question

2. Provide recommendations for effective on-the-job training.

Answered: 1 week ago