Back to marketplace

logistic regression

No description yet. This curated deck is ready for daily study.

Total cards: 24•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (24)

#1
Front (Question)

disadvantage of linear model?

Back (Answer)

predicted probabilities may be below 0 or above 1

#2
Front (Question)

what does logic(p) equal to?

Back (Answer)

ln(p/1-p)=β0+β1*x (β1 is the expected increase in log-odds when X increases by one unit)

#3
Front (Question)

intercept in odds?

Back (Answer)

e^β0

#4
Front (Question)

slope

Back (Answer)

e^β1

#5
Front (Question)

can estimate β be interpreted as a change in the probability Y=1 associate with unit change in X?

Back (Answer)

No. Odds not linear

#6
Front (Question)

sensitivity?

Back (Answer)

TP/P (used if FN more costly than FP), RAISE SENSITIVITY BY CLASSIFYING MORE AS ‘YES’ (less FN but more FP, specificity reduced)

#7
Front (Question)

true positive rate?

Back (Answer)

TP/P (Sensitivity 1 – Type 2 error)

#8
Front (Question)

false positive rate?

Back (Answer)

FP/N (1 – Specificity Type 1 error)

#9
Front (Question)

positive prediction rate?

Back (Answer)

TP/hat P (precision)

#10
Front (Question)

negative prediction rate?

Back (Answer)

TN/ hat N

#11
Front (Question)

what doesROC (Receiver Operator Characteristic) curve traces out?

Back (Answer)

true positive rate and false positive rate as we vary the probability threshold from 0 to 1

#12
Front (Question)

AUC is the area under the ROC curve. what does it measure?

Back (Answer)

it measures overall performance of classifier (max AUC=1) the larger the better the classifier

#13
Front (Question)

what is the chance line?

Back (Answer)

random guess can produce the classifier at a 45 degree angle. no classifier should be worse than this line. AUC=0.5

#14
Front (Question)

for cross validation, what is used instead of MSEs

Back (Answer)

number of misclassified observations

#15
Front (Question)

converting factor variable for numeric linear regression (has negative values so ignore)

Back (Answer)

Default$default_yes = ifelse(Default$default == “Yes”, 1, 0) lm_fit = lm(default_yes ~ balance, data = Default) summary(lm_fit)

#16
Front (Question)

to tell R to use logistic regression,

Back (Answer)

use family=binomial e.g.glm_fit1 = glm(default ~ student, data = Default, family = binomial) summary(glm_fit1)

#17
Front (Question)

to make predictions?

Back (Answer)

predict(glm_fit1,newdata=data.frame(variable,c(option1,option2 etc)),type=’response’)

#18
Front (Question)

find probability of first 10 predictions?

Back (Answer)

glm_prob = predict(glm_fit2, type = “response”) glm_prob[1:10]

#19
Front (Question)

confusion matrix of probability threshold of 0.5?

Back (Answer)

confusion_matrix=table(glm_prob>0.5,Default$default)

#20
Front (Question)

to find AUC(area under ROC curve)?

Back (Answer)

pred=prediction(glm_prob,Default$default) perf=performance(pred, measure=’tpr’, x.measure=’fpr’) auc_perf=performance(perf, measure=’auc’) round(auc_perf@y.values[[1]],2)

#21
Front (Question)

plot ROC curve with chance line?

Back (Answer)

plot(perf) abline(0,1,lwd=1,lty=2) # Add text to the ROC plot text(0.4, 0.8, paste(“AUC =”, round(auc_perf@y.values[[1]], 2)))

#22
Front (Question)

find accuracy?

Back (Answer)

accuracy_perf = performance(pred, measure = “acc”) plot(accuracy_perf, col = “deeppink3”, lwd = 2) ind = which.max(slot(accuracy_perf, “y.values”)[[1]]) acc = slot(accuracy_perf, “y.values”)[[1]][ind] cutoff = slot(accuracy_perf, “x.values”)[[1]][ind] print(c(accuracy = acc, cutoff = cutoff))

#23
Front (Question)

add accuracy point on curve?

Back (Answer)

points(cutoff, acc, type = “p”) text(0.6, 0.86, “(0.4299, 0.9740)”, cex = 0.85)

#24
Front (Question)

most accurate confusion matrix?

Back (Answer)

confusion_matrix=table(glm_prob>cutoff, Default$default) confusion_matrix