Closed wboykinm closed 6 years ago
Looks like the error is coming from
It can happen if tp+fp=0
, tp+fn=0
, tn+fp=0
, or tn+fn=0
.
In this case we probably should just return float("nan")
- what do you think @ocourtin?
@daniel-j-h
Indeed the metrics should be more robust to division by zero...
I've just created a new branch with a related fix: https://github.com/ocourtin/robosat/tree/nan https://github.com/mapbox/robosat/compare/master...ocourtin:nan
@wboykinm Could you give a try ?
@ocourtin That seems to have done the trick on the division by zero error! Thanks for adding the handler!
(Of course I'm on to newer and bigger failures, but that doesn't appear related and I'll try some debugging before I whine about that one.)
@daniel-j-h New related PR: https://github.com/mapbox/robosat/pull/127
@wboykinm Thanks for the test and report, and replyied on the 'newer and bigger' one...
Getting
. . . following the completion of a single epoch (out of a total of 1) in this workflow. It's unclear from the traceback where exactly the zero is being invoked, or how it could be fixed in either the config
.toml
s or the inputs. It seems related to this division, but it's not clear how a situation wherenum_samples = 0
could get through the validity check just above it.cc @jacquestardie