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

Proposal to get TP, FP, FN of all targets #80

Open
sathyarr opened this issue Jul 5, 2021 · 0 comments
Open

Proposal to get TP, FP, FN of all targets #80

sathyarr opened this issue Jul 5, 2021 · 0 comments

Comments

@sathyarr
Copy link

sathyarr commented Jul 5, 2021

Feature description

Proposal to get TP, FP, FN of all targets:

At a certain point, we have three different arrays for all the targets,
tp_sum, pred_sum, true_sum

e.g.,

target_names = ['person', 'org', 'place']
tp_sum   = [1 0 0]
pred_sum = [1 0 1]
true_sum = [1 1 0]

Here, tp_sum is used as numerator of both Precision and Recall calculations.

So, tp_sum is nothing but a collection of True Positive counts of each target.


pred_sum is being used as denominator of Precision.
As per Precision's definition then, pred_sum == TP + FP

Here, we already know the count of TP (from tp_sum).
To get FP, we shall do, FP = pred_sum - tp_sum


true_sum is being used as denominator of Recall.
As per Recall's definition then, true_sum == TP + FN

Here, we already know the count of TP again (from tp_sum)
To get FN, we shall do, FN = true_sum - tp_sum


Does this sound logical?

If so, better to add a function for this, like performance_measure?

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

1 participant