RoshanRane / Deviance_explained

Deviance explained metric implemented in python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deviance Explained

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 $R^2$ in regression tasks[1] and is also referred to as pseudo-R-squared.

This implementation is based on McFadden’s equation[2].

How to use

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.

References:

[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.

About

Deviance explained metric implemented in python

License:Creative Commons Zero v1.0 Universal


Languages

Language:Jupyter Notebook 97.5%Language:Python 2.5%