Skip to content

[WIP ]Added labelwise metrics with tests #542

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

anmolsjoshi
Copy link
Contributor

Fixes #513 and #516

Description:
Added tests

Check list:

  • New tests are added (if a new feature is added)
  • New doc strings: description and/or example code are in RST format
  • Documentation is updated (if required)

@anmolsjoshi anmolsjoshi requested a review from vfdev-5 June 5, 2019 04:04
@anmolsjoshi
Copy link
Contributor Author

@vfdev-5 I have at least added Accuracy with labelwise option. Wanted to further discuss Precision and Recall before implementing.

Copy link
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

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

I'm not a fan of another bool flag labelwise. Idea is to introduce a new variable, e.g multilabel that takes values for example exact, labelwise, top-K with variable K (top-3, top-5 etc):

  • exact is current is_multilabel=True behaviour
  • labelwise is your implementation behaviour with labelwise=True
  • top-K with parsing K into an integer and computes top-k multi-label accuracy.

@anmolsjoshi what do you think ?

Old argument is_multilabel becomes deprecated and will be removed since 0.3.0

def __init__(self, output_transform=lambda x: x, is_multilabel=False):
def __init__(self, output_transform=lambda x: x, is_multilabel=False, labelwise=False):
if labelwise and not is_multilabel:
raise ValueError("labelwise is only applicable for multilabel cases. If labelise=True, is_multilabel=True.")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
raise ValueError("labelwise is only applicable for multilabel cases. If labelise=True, is_multilabel=True.")
raise ValueError("labelwise is only applicable for multilabel cases. If labelwise=True, is_multilabel=True.")

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.

Label-wise metrics (Accuracy etc.) for multi-label problems
2 participants