books
books copied to clipboard
Incorrect McFadden's Pseudo-R2
The way the McFadden's R2 is calculated in this notebook (Psuedo r-squared for logistic regression) is incorrect.
The null model should be a fitted model with only the intercept fitted, not the full model with all the coefficients zeroed except for the intercept.
In fact, the result obtained in the notebook does not match with statsmodels Logit results, nor with Scikit learn results with correct implementation. See this notebook: https://colab.research.google.com/drive/1sL2BILNb60l6KM-1zk6yAk_Jtqkb4lUl?usp=sharing.