Skip to content

Add balanced_accuracy_score metrics #3506

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

Closed
arjoly opened this issue Jul 30, 2014 · 14 comments
Closed

Add balanced_accuracy_score metrics #3506

arjoly opened this issue Jul 30, 2014 · 14 comments
Labels
Easy Well-defined and straightforward way to resolve New Feature

Comments

@arjoly
Copy link
Member

arjoly commented Jul 30, 2014

There have been some discussion about adding a balanced accuracy metrics (see this article for the definition) on the mailing list. This is a good opportunity for a first contribution.

This implies coding the function, checking correctness through tests and highlight your work with documentations. In order to be easily used by many, a balanced accuracy scorer is a good idea. As a bonus, it could also support sample_weight.

@lazywei
Copy link
Contributor

lazywei commented Jul 30, 2014

I'm trying to work on this. I have a little question, however.
I don't really understand the definition of TP, TN, FP, FN when the classification type is not binary.
I mean, what is "positive" when it is multiclass, or multilabel?

By the way, sensitive is by definition TP / (TP + FN). I'm wondering what if TP + FN = 0?
That is, when y_true = [0, 0, 0, 0]?

I'm not really familiar with the terms TP, FN etc. So please correct me if I make any mistake.

Thanks.

@jnothman
Copy link
Member

Perhaps it should just support the binary case at first.

On 31 July 2014 03:38, Bert Chang notifications@github.com wrote:

I'm trying to work on this. I have a little question, however.
I don't really understand the definition of TP, TN, FP, FN when the
classification type is not binary.
I mean, what is "positive" when it is multiclass, or multilabel?

Thanks.


Reply to this email directly or view it on GitHub
#3506 (comment)
.

@larsmans
Copy link
Member

TP, TN, FP and FN are only well-defined when one class is considered negative (which is quite common). Usually we pick the class that is smallest according to Python's standard ordering unless overridden by the user.

@adam-m-mcelhinney
Copy link

@lazywei , did you get a chance to start on this? If not, I may take a stab at it.

@lazywei
Copy link
Contributor

lazywei commented Oct 22, 2014

@adam-m-mcelhinney
I have started a PR at #3511 , and I thought I've finished...
Anyway, I think you could check out my branch to do more base on it if you want. In that case, let me know when you have done, I'll close my PR.
Thanks

@adam-m-mcelhinney
Copy link

Got it. Thanks.

@ogrisel
Copy link
Member

ogrisel commented Dec 2, 2014

@ppuggioni you have worked on this during the sprint: can you please open a PR with a [WIP] marker in the title with the current state of your work?

@ppuggioni
Copy link
Contributor

@ogrisel yes, but yesterday I realised that @lazywei had possibly already done the job. I will push mine and open a PR with [WIP], but I was thinking that it might be worth for me to compare mine to his to avoid duplications and double review process?

@ogrisel
Copy link
Member

ogrisel commented Dec 2, 2014

Indeed, please submit yours and cross reference the 2 PR to compare the results.

@xuewei4d
Copy link
Contributor

Hi all,

May I take over this issue? It seems that the referenced two PRs have stalled.

I have done coding, documentation, and testing. I found the balanced accuracy score is equal to the average of positive label recall and negative label recall. I did not take the balance weight into account. Since in the wikipedia, it is fixed as 0.5. So my code is quite simple. May I open a [WIP]PR? @ogrisel @jnothman

I am new to scikit-learn development, but I have used the package for a long time. I am a PhD student studying in machine learning. I hope I can join in GSOC 2015.

Thanks,

@adam-m-mcelhinney
Copy link

I haven't touched it. I believe someone else had finished it however.

On Wed, Feb 25, 2015 at 4:20 PM, Wei Xue notifications@github.com wrote:

Hi all,

May I take over this issue? It seems that the referenced two PRs have
stalled.

I have done coding, documentation, and testing. I found the balanced
accuracy score is equal to the average of positive label recall and
negative label recall. I did not take the balance weight into account.
Since in the wikipedia, it is fixed as 0.5. So my code is quite simple. May
I open a [WIP]PR?

I am new to scikit-learn development, but I have used the package for a
long time. I am a PhD student studying in machine learning. I hope I can
join in GSOC 2015.

Thanks,


Reply to this email directly or view it on GitHub
#3506 (comment)
.

@xuewei4d
Copy link
Contributor

hi, @adam-m-mcelhinney,

Searching keywords balanced accuracy shows only two relevant PR #3929 and #3511. They have no progress since last year. If some else had finished it, he/she would have cross reference this issue #3506.

@adam-m-mcelhinney
Copy link

Looks like its all yours then. Let me know if you want to collaborate on
anything.

On Wed, Feb 25, 2015 at 5:09 PM, Wei Xue notifications@github.com wrote:

hi, @adam-m-mcelhinney https://github.com/adam-m-mcelhinney,

Searching keywords balanced accuracy shows only two relevant PR #3929
#3929 and #3511
#3511. They have no
progress since last year. If some else had finished it, he/she would have
cross reference this issue #3506
#3506.


Reply to this email directly or view it on GitHub
#3506 (comment)
.

@lesteve
Copy link
Member

lesteve commented Oct 18, 2017

Closed by #8066.

@lesteve lesteve closed this as completed Oct 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Easy Well-defined and straightforward way to resolve New Feature
Projects
None yet
Development

No branches or pull requests

9 participants