Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Carlos Coronel, Steven Morris

14th Edition

978-0357673034

More Books

Students also viewed these Databases questions

Question

How do Data Types perform data validation?

Answered: 1 week ago

Question

How does Referential Integrity work?

Answered: 1 week ago