• No products in the cart.

204.2.4 Goodness of fit for Logistic Regression

How good our model is?
Link to the previous post :https://course.dvanalyticsmds.com/204-2-3-multiple-logistic-regression/

Goodness of Fit for a 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.

  • Classification Matrix
  • AIC and BIC
  • ROC & AUC

Out of these three we will go through Classification matrix or confusion matrix in this post and understand rest in upcoming posts.

Classification Table & Accuracy

Predicted / Actual 0 1
0 True Positive (TP) False Positive (FP)
1 False Negative (FN) True Negative (TN)
  • Also known as confusion matrix
  • Accuracy=(TP+TN)/(TP+FP+FN+TN)

Practice : Confusion Matrix & Accuracy

  • Create confusion matrix for Fiber bits model(Model built in previous posts of this series)
In [25]:
###for using confusion matrix###
from sklearn.metrics import confusion_matrix
cm1 = confusion_matrix(Fiber[['active_cust']],predict1)
print(cm1)
[[29210 12931]
 [10183 47676]]
  • Find the accuracy value for fiber bits model
In [26]:
total1=sum(sum(cm1))
accuracy1=(cm1[0,0]+cm1[1,1])/total1
accuracy1
Out[26]:
0.76885999999999999

The next post is about multicollinearity and individual impact of variables in logistic regression.
Link to the next post : https://course.dvanalyticsmds.com/204-2-5-multicollinearity-and-individual-impact-of-variables-in-logistic-regression/

DV Analytics

DV Data & Analytics is a leading data science,  Cyber Security training and consulting firm, led by industry experts. We are aiming to train and prepare resources to acquire the most in-demand data science job opportunities in India and abroad.

Bangalore Center

DV Data & Analytics Bangalore Private Limited
#52, 2nd Floor:
Malleshpalya Maruthinagar Bengaluru.
Bangalore 560075
India
(+91) 9019 030 033 (+91) 8095 881 188
Email: info@dvanalyticsmds.com

Bhubneshwar Center

DV Data & Analytics Private Limited Bhubaneswar
Plot No A/7 :
Adjacent to Maharaja Cine Complex, Bhoinagar, Acharya Vihar
Bhubaneswar 751022
(+91) 8095 881 188 (+91) 8249 430 414
Email: info@dvanalyticsmds.com

top
© 2020. All Rights Reserved.