O'Reilly logo

Practical Data Science Cookbook - Second Edition by Abhijit Dasgupta, Benjamin Bengfort, Sean Patrick Murphy, Tony Ojeda, Prabhanjan Tattar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

We will now build a logistic regression model here:

  1. Using the glm function, we build a logistic regression model for the training dataset GC_Train and then apply the summary function to get the details of the fitted model:
GC_Logistic <- glm (good_bad~., data= GC_Train, family= 'binomial' ) summary (GC_Logistic) ## ## Call: ## glm(formula = good_bad ~ ., family = "binomial", data = GC_Train) ## ## Deviance Residuals: ## Min 1Q Median 3Q Max ## -2.428 -0.725 0.374 0.715 2.222 ## ## Coefficients: ## Estimate Std. Error z value Pr(>|z|) ## (Intercept) 1.42e+00 1.35e+00 1.05 0.2927 ## checking0 <= ... < 200 DM 1.24e-01 2.86e-01 0.44 0.6634 ## checking>= 200 DM 5.08e-01 4.81e-01 1.06 0.2913 ## checkingNo Acc 1.65e+00 3.06e-01 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required