glum icon indicating copy to clipboard operation
glum copied to clipboard

Request for a force_finite flag for score function

Open thobanster opened this issue 2 years ago • 1 comments

The r2_score method in sklearn has a force_finite flag which defaults to True in order to avoid infinite and NaN values when the TSS happens to be 0. The analogous quantity when computing D^2 is the null deviance, which can also sometimes be 0. It would be great if, in glum, there was also a force_finite flag that can gracefully handle the case where the null deviance happens to be 0. Right now, I get a ZeroDivisionError in glum 2.1.2 running in Python 3.6.

thobanster avatar Jul 13 '22 17:07 thobanster

Very late to the game, but: Why do we use a pseudo-R² as the score at all? Couldn't we just report the negative or inverse deviance? For tuning purposes, it shouldn't change the ranking of parametrisations. @MarcAntoineSchmidtQC @jtilly

lbittarello avatar Mar 15 '23 08:03 lbittarello