library(MASS)
library(randomForest)
Bdata <- read.csv("banking_data.csv")
head(Bdata)
Bdata$y <- ifelse(Bdata$y == "y", 1, 0)
intercept_model<- glm(y~1,family = binomial("logit"),data=Bdata)
summary(intercept_model)
(exp(intercept_model$coefficients[1]))/(1+exp(intercept_model$coefficients[1]))
I tried to run this code but it shows Warning:
glm.fit: algorithm did not converge
It shows :
Call:
glm(formula = y ~ 1, family = binomial("logit"), data = Bdata)
Deviance Residuals:
Min 1Q Median 3Q Max
-2.409e-06 -2.409e-06 -2.409e-06 -2.409e-06 -2.409e-06
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -26.57 1754.75 -0.015 0.988
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 0.0000e+00 on 41187 degrees of freedom
Residual deviance: 2.3896e-07 on 41187 degrees of freedom
AIC: 2
Number of Fisher Scoring iterations: 25