Skip to content

[WIP] add balanced_accuracy_score metric #3506#3929

Closed
ppuggioni wants to merge 1 commit intoscikit-learn:masterfrom
ppuggioni:balanced-score
Closed

[WIP] add balanced_accuracy_score metric #3506#3929
ppuggioni wants to merge 1 commit intoscikit-learn:masterfrom
ppuggioni:balanced-score

Conversation

@ppuggioni
Copy link
Copy Markdown
Contributor

It refers to the issue #3506

  • It passes all the common tests for metrics and regression metrics, but I still need to implement specific tests.
  • It might be a duplicate of the work done by @lazywei at [WIP] balanced accuracy score #3511 , so I will compare the two versions

@lazywei
Copy link
Copy Markdown
Contributor

lazywei commented Dec 3, 2014

Oh, so should I close mine PR? There are still some TODOs in my PR that I haven't finished though.
Great work 👍

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should multilabel be supported?

@jmetzen
Copy link
Copy Markdown
Member

jmetzen commented Dec 14, 2014

Would be nice to add an example illustrating possible use-cases of balanced accuracy. For instance a binary classification task with highly imbalanced classes, where a classifier which assigns everything to the majority class obtains high accuracy but low balanced-accuracy.

@jnothman
Copy link
Copy Markdown
Member

I'm not sure if the documentation has a similar example for P/R/F, but an
annotated comparison between them (accuracy, balanced accuracy, P, R, AUC)
makes some sense.

On 14 December 2014 at 23:45, Jan Hendrik Metzen [email protected]
wrote:

Would be nice to add an example illustrating possible use-cases of
balanced accuracy. For instance a binary classification task with highly
imbalanced classes, where a classifier which assigns everything to the
majority class obtains high accuracy but low balanced-accuracy.


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

@ppuggioni
Copy link
Copy Markdown
Contributor Author

I think adding an example would be a good idea. I will work on the comment by @jnothman and then on an example in a couple of weeks during the christmas break!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no one-letter parameters ;)

@amueller
Copy link
Copy Markdown
Member

The other PR says
In binary and multiclass classification, this function is equal to thejaccard_similarity_scorefunction.
So if this is added the addition is for multi-label indicator, right?

@xuewei4d
Copy link
Copy Markdown
Contributor

@amueller No. I don't think so. For example,

>>> jaccard_similarity_score(np.array([[0,0,1,1,1]]), np.array([[1, 1,1,0, 1]]))
0.4
>>> balanced_accuracy_score(np.array([0,0,1,1,1]), np.array([1,1,1,0,1]))
0.33333333333333331

The wikipedia definition of jaccard similarity http://en.wikipedia.org/wiki/Jaccard_index#Similarity_of_asymmetric_binary_attributes
is quite different from
http://en.wikipedia.org/wiki/Accuracy_and_precision#In_binary_classification.

@arjoly
Copy link
Copy Markdown
Member

arjoly commented Oct 24, 2015

closed in favor of #5588

@arjoly arjoly closed this Oct 24, 2015
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

Successfully merging this pull request may close these issues.

7 participants