from sklearn.linear_model import LogisticRegression
 classifier = LogisticRegression()
 classifier.fit(X_train, y_train)

 # the overall equation was not significant
 (p < .47) and all 95% confidence intervals for the odds ratios for the three
 variables included 1.00, indicating no significant relationship between 
 missingness and any of the other variables.

I checked the online resources. I wonder how do I use sklearn package to achieve it, especially the overall significance of the equation.

  • 2
    $\begingroup$ What is the question? $\endgroup$ – user2974951 Sep 19 '18 at 8:42
  • $\begingroup$ How do I check the overall significance of this logistic regression using python? $\endgroup$ – Tom Sep 19 '18 at 15:57
  • $\begingroup$ Logistic regression model should return a null and model deviance, which you can use to calculate a p-value based on a chi-square test, to determine if your model is better then the null model, that is a model with only an intercept. $\endgroup$ – user2974951 Sep 19 '18 at 17:30
  • $\begingroup$ Could you give me more details about it? I want to implement your idea. I have some difficulties coding it out. $\endgroup$ – Tom Sep 19 '18 at 21:49
  • $\begingroup$ This should be returned automatically, at least it does so in R. If Python doesn't, then find a function to calculate the deviance of models, in R it's deviance(). Or even better, build a model with only the intercept and your desired model, and then compare them with an ANOVA, this should be available in Python, in R anova(model.null,model). $\endgroup$ – user2974951 Sep 20 '18 at 6:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.