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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started