Deviance Explained metric implemented in python. Deviance Explained is a useful metric for evaluating machine learning models performing classification. It is a quantity between 0 (model fit is chance-level) and 1 (model fit is perfect). It is similar to
This implementation is based on McFadden’s equation[2].
Simply use the explained_deviance(y_true, y_pred_probas)
function in deviance.py
. All dependant packages are imported in the python file.
The function should work same as any other sklearn metric.
[1] Eduardo García-Portugués Lab notes for Statistics for Social Sciences II: Multivariate Techniques: https://bookdown.org/egarpor/SSS2-UC3M/logreg-deviance.html
[2] McFadden, D. (1974) “Conditional logit analysis of qualitative choice behavior.” Pp. 105-142 in P. Zarembka (ed.), Frontiers in Econometrics. Academic Press.