Question: Using the iris dataset in R Studio, subset the dataset so you have the first 2 5 versicolor observations and the first 2 5 virginica

Using the iris dataset in R Studio, subset the dataset so you have the first 25 versicolor observations and the first 25 virginica in a training dataset. Put the rest (versicolor and virginica) in a test dataset. Build a logistic regression model (you don't have to make your own) of species predicted by petal width. Next, predict the class (virginica) in the test data, using a cutpoint of 0.5 for probability.
Question 1: What is the accuracy? Round to 2 decimal places.
Question 2: What is the sensitivity for the same? Round to 2 decimal places.
Question 3: What is the precision? Round to 2 decimal places.
Question 4: What is the specificity? Round to 2 decimal places.
Please also provide R code.

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 Programming Questions!