Question: With the following code, please help me answer these three questions library(ISLR) help(Default) set.seed(0) rows=sample(1:10000, 8000, replace=F) train= Default[rows,] test = Default[-rows,] model = glm(default

With the following code, please help me answer these three questions

library(ISLR) help("Default")

set.seed(0)

rows=sample(1:10000, 8000, replace=F)

train= Default[rows,]

test = Default[-rows,]

model = glm(default ~ student + balance, data = train, family = "binomial")

First, create the confusion matrix on training data. Use threshold probability p=0.5 throughout to create the confusion matrix. What is the accuracy of the logistic regression on the training data?

Secondly, what is the probability of default according to our logistic regression model for someone who is NOT a student and has balance of $2111?

Thirdly, create a confusion matrix on the testing dataset. what is the the output for the specificity on the testing data?

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!