datacraft-sciences / confuse

Eclipse Public License 1.0
32 stars 3 forks source link

failure if all predictions are wrong #13

Open behrica opened 1 year ago

behrica commented 1 year ago

I get a division-y-zero exception doing any of:

(mcm/macro-avg-fmeasure [:a] [:b] [:a :b])
(mcm/micro-avg-fmeasure [:a] [:b] [:a :b])

for reference, sklearn returns 0.0:

>>> import sklearn
>>> sklearn.metrics.f1_score([0],[1], average='macro')
0.0
>>> sklearn.metrics.f1_score([0],[1], average='micro')
0.0
shark8me commented 1 year ago

Thanks for this, I might get to looking at this sometime next week.