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

Using the iris data set 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. What is the accuracy? Round to 2 decimal places. (please show R script)

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!