• No products in the cart.

203.2.4 Goodness of fit for Logistic Regression

Goodness of Fit for a Logistic Regression

In previous section, we studied about Multiple Logistic Regression

  • Classification Matrix
  • Accuracy

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=\frac{(TP+TN)}{(TP+FP+FN+TN)}\)

Classification Table in R

threshold=0.5
predicted_values<-ifelse(predict(prod_sales_Logit_model,type="response")>threshold,1,0)
actual_values<-prod_sales_Logit_model$y

conf_matrix<-table(predicted_values,actual_values)
conf_matrix
##                 actual_values
## predicted_values   0   1
##                0 257   3
##                1   5 202

Accuracy in R

accuracy<-(conf_matrix[1,1]+conf_matrix[2,2])/(sum(conf_matrix))
accuracy
## [1] 0.9828694

 

The next post is about multi collinearity an 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.