Question: Please use R! Thanks Consider the data set iris from the R library ggplot2. Here is the instructor's ggplot2 version packageVersion(ggplot2) ## [1] '3.1.0 You

Please use R! Thanks Consider the data set iris from the RPlease use R! Thanks

Consider the data set iris from the R library ggplot2. Here is the instructor's ggplot2 version packageVersion("ggplot2") ## [1] '3.1.0 You can use help(iris) to obtain some help information on this data set, or you can do the following: library(ggplot2) data(iris) head (iris) 1.4 ## ## 1 ## 2 ## 3 ## 4 ## 5 ## 6 Sepal. Length Sepal.Width Petal.Length Petal.Width Species 5.1 3.5 0.2 setosa 4.9 3.0 1.4 0.2 setosa 4.7 3.2 1.3 0.2 setosa 4.6 3.1 1.5 0.2 setosa 5.0 3.6 1.4 0.2 setosa 5.4 1.7 0.4 setosa 3.9 From the iris data set, pick all observations for the subspecies setosa and versicolor. For each of the 2 subspecies, use set.seed (123) to randomly select 40 observations. Use these 80 observations as a training data set, and the rest 20 observations as a testing data set. Note that when there are only two subspecies setosa and versicolor, an observation either is setosa or not. (4.a) Build a logistic regression model using the train data set and apply the obtained model to the testing data set. Report classification results on the testing data set. For this task, classify an observation as versicolor if its associated predicted probability is greater than 0.5. (4.b) Build a linear discriminant analysis model using the train data set and apply the obtained model to the testing data set. Report classification results on the testing data set. (4.c) Build a quadratic discriminant analysis model using the train data set and apply the obtained model to the testing data set. Report classification results on the testing data set. (4.d) Comment on the classification results in (4.a) to (4.c). Consider the data set iris from the R library ggplot2. Here is the instructor's ggplot2 version packageVersion("ggplot2") ## [1] '3.1.0 You can use help(iris) to obtain some help information on this data set, or you can do the following: library(ggplot2) data(iris) head (iris) 1.4 ## ## 1 ## 2 ## 3 ## 4 ## 5 ## 6 Sepal. Length Sepal.Width Petal.Length Petal.Width Species 5.1 3.5 0.2 setosa 4.9 3.0 1.4 0.2 setosa 4.7 3.2 1.3 0.2 setosa 4.6 3.1 1.5 0.2 setosa 5.0 3.6 1.4 0.2 setosa 5.4 1.7 0.4 setosa 3.9 From the iris data set, pick all observations for the subspecies setosa and versicolor. For each of the 2 subspecies, use set.seed (123) to randomly select 40 observations. Use these 80 observations as a training data set, and the rest 20 observations as a testing data set. Note that when there are only two subspecies setosa and versicolor, an observation either is setosa or not. (4.a) Build a logistic regression model using the train data set and apply the obtained model to the testing data set. Report classification results on the testing data set. For this task, classify an observation as versicolor if its associated predicted probability is greater than 0.5. (4.b) Build a linear discriminant analysis model using the train data set and apply the obtained model to the testing data set. Report classification results on the testing data set. (4.c) Build a quadratic discriminant analysis model using the train data set and apply the obtained model to the testing data set. Report classification results on the testing data set. (4.d) Comment on the classification results in (4.a) to (4.c)

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!