Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#construct ROC curve alph

#construct ROC curve alph<-seq(0.01,1,0.01)

roc1<-matrix(0,length(alph),3) roc1[,1]<-alph for(i in 1:length(alph)) {mLR.cli<-ifelse(mLR.pr>alph[i],1,0) mLR.cmi<-table(mLR.cli,ojTest[,1])

if((dim(mLR.cmi)[1])<2) {mLR.cmi<-rbind(mLR.cmi,c(0,0))} #what is this? roc1[i,2]<-1-(conf.fun(mLR.cmi)[3]) roc1[i,3]<-conf.fun(mLR.cmi)[2]}

plot(roc1[,2],roc1[,3],type="l",col=2,ylab="sensitivity", xlab="1-specificity",main="ROC curve - Logistic Regression") abline(0,1,col="grey")

Q: if((dim(mLR.cmi)[1])<2) {mLR.cmi<-rbind(mLR.cmi,c(0,0))} #what is this?

What is the function of this line of code? Thanks.

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

DB2 11 The Database For Big Data And Analytics

Authors: Cristian Molaro, Surekha Parekh, Terry Purcell, Julian Stuhler

1st Edition

1583473858, 978-1583473856

More Books

Students also viewed these Databases questions

Question

5. Have you stressed the topics relevance to your audience?

Answered: 1 week ago