logistic regression residuals plot/distribution

Viewed 1600

I am trying to evaluate the logistic model with residual plot in Python.
I searched on the internet and cannot get the info.
It seems that we can calculate the deviance residual from this answer.

from sklearn.metrics import log_loss
def deviance(X_test, true, model):
    return 2*log_loss(y_true, model.predict_log_proba(X_test))

This returns a numeric value.

However, we can evaluate residuals plot when performing GLM.... It seems that there are no packages for Python to plot logistic regression residuals, pearson or deviance.

Moreover, I found a interesting package ResidualsPlot. But I'm not sure whether it can be used for logistic regression.

Any suggestion for plotting residuals plot?

In addition, I also found a resource here, which is for ols rather than logit. It seems that the calculations of residuals are a little bit different.

0 Answers
Related