Calculate residual deviance from scikit-learn logistic regression model
问题 Is there any way to calculate residual deviance of a scikit-learn logistic regression model? This is a standard output from R model summaries, but I couldn't find it any of sklearn's documentation. 回答1: Actually, you can. Deviance is closely related to cross entropy, which is in sklearn.metrics.log_loss . Deviance is just 2*(loglikelihood_of_saturated_model - loglikelihood_of_fitted_model). Scikit learn can (without larger tweaks) only handle classification of individual instances, so that