Link to the previous post :https://statinfer.com/204-2-3-multiple-logistic-regression/
There are quite a lot of methods to find how good a model is. However, we will stick to the most important measures applicable for a logistic regression model.
Out of these three we will go through Classification matrix or confusion matrix in this post and understand rest in upcoming posts.
|Predicted / Actual||0||1|
|0||True Positive (TP)||False Positive (FP)|
|1||False Negative (FN)||True Negative (TN)|
###for using confusion matrix### from sklearn.metrics import confusion_matrix cm1 = confusion_matrix(Fiber[['active_cust']],predict1) print(cm1)
[[29210 12931] [10183 47676]]
total1=sum(sum(cm1)) accuracy1=(cm1[0,0]+cm1[1,1])/total1 accuracy1
0.76885999999999999 The next post is about multicollinearity and individual impact of variables in logistic regression. Link to the next post : https://statinfer.com/204-2-5-multicollinearity-and-individual-impact-of-variables-in-logistic-regression/