Question: Need to run logistic regression on stroke dataset from Kaggle. https://www.kaggle.com/fedesoriano/stroke-prediction-dataset Please indicate the variables to be considered for the regression and post-confusion matrix. Also,
Need to run logistic regression on stroke dataset from Kaggle. https://www.kaggle.com/fedesoriano/stroke-prediction-dataset
Please indicate the variables to be considered for the regression and post-confusion matrix. Also, please R programming to calculate the results.
I am getting 95% accuracy but with zero true positives (not able to predict stroke ==1). I am also attaching a screenshot of my results. Not able to figure to how to improve true positives cases. It would be a great help if you can provide with a solution.

call: Confusion Matrix and Statistics glm(formula = stroke ~ . , family = "binomial", data = train. of) Deviance Residuals: Min 1Q Median 3Q Max FALSE TRUE -1. 0935 -0. 3127 -0. 1542 -0. 0796 3. 6077 FALSE 1240 60 coefficients : TRUE 3 0 Estimate Std. Error z value pr (>|z1) (Intercept) -6. 8934553 1. 0958739 -6. 290 0. 000000000317 -0. 1237049 -0. 661 Accuracy : 0. 9517 genderMale 0. 1872739 0. 509 age 0. 0813864 0. 0078676 10. 344 NIR] : 0. 6838 work_typeGovt_job -1. 1761884 1. 1699998 -1. 005 0. 315 work_typeNever_worked -10.1714285 402. 2048051 -0. 025 0. 980 Kappa : -0. 0044 work_typeprivate -0. 8503511 1. 1445973 -0. 743 0. 458 work_typeself -employed -1. 3159990 1. 1711731 -1. 124 0. 261 Residence_typeurban 0. 1395732 0. 1817295 0. 768 0. 442 Mcnemar's Test P-Value : 0. 000000000001722 avg_glucose_level 0. 0039281 0. 0015634 2. 513 0. 012 bmi -0. 0007984 0. 0148181 -0. 054 0. 957 smoking_statusnever smoked -0. 2829164 0. 2294799 -1. 233 0. 218 Sensitivity : 0. 9976 smoking_statussmokes 0. 0238334 0. 2832035 0. 084 0. 933 Specificity : 0. 0000 smoking_statusUnknown -0. 1134773 0. 2702838 -0. 420 0. 675 Pos Pred Value : 0. 9538 Signif. codes: 0 '* * *' 0. 001 '* *' 0. 01 '*' 0. 05 ' . ' 0.1 ' ' 1 Neg Pred Value : 0. 0000 Prevalence : 0. 9540 (Dispersion parameter for binomial family taken to be 1) Detection Rate : 0. 9517 Null deviance: 1189.14 on 3038 degrees of freedom Detection Prevalence : 0. 9977 Residual deviance: 924. 31 on 3023 degrees of freedom Balanced Accuracy : 0. 4988 AIC : 956. 31 Number of Fisher Scoring iterations: 14 'positive' class : FALSE
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
