Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

F-score expresion is wrong #1525

Open
alfonsomhc opened this issue May 18, 2015 · 1 comment
Open

F-score expresion is wrong #1525

alfonsomhc opened this issue May 18, 2015 · 1 comment

Comments

@alfonsomhc
Copy link

The F-score expresion in compute_f1() in expr/nnet.py is given by:

f1 = (2. * precision * recall /
T.maximum(1, precision + recall))

As far as I understand, T.maximum() is used to avoid the denominator from being zero. While this protection is fine in compute_recall() and compute_precision() in the same file, in compute_f1() this is wrong because precision+recall can legitimally be lower than 1, and in those cases, the reported f-score would be wrong (lower than it should be).

My suggestion is to implement this formula instead:

f1 = 2_hits / maximum(1,2_hits + false_alarms + misses)

@NileshPant1999
Copy link

I think using
f1= 2_hits/max(1,2_hits+false_alarms+misses)
would be a great idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants