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

classification metrics #4043

Merged
merged 7 commits into from
Oct 10, 2020
Merged

classification metrics #4043

merged 7 commits into from
Oct 10, 2020

Conversation

ananyahjha93
Copy link
Contributor

What does this PR do?

adds classification metrics.

Fixes # (issue)

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together? Otherwise, we ask you to create a separate PR for every change.
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?
  • Did you verify new and existing tests pass locally with your changes?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@mergify mergify bot requested a review from a team October 10, 2020 03:40
@pep8speaks
Copy link

pep8speaks commented Oct 10, 2020

Hello @ananyahjha93! Thanks for updating this PR.

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2020-10-10 15:58:13 UTC

@codecov
Copy link

codecov bot commented Oct 10, 2020

Codecov Report

Merging #4043 into master will increase coverage by 0%.
The diff coverage is 99%.

@@           Coverage Diff           @@
##           master   #4043    +/-   ##
=======================================
  Coverage      92%     92%            
=======================================
  Files         105     107     +2     
  Lines        7815    7920   +105     
=======================================
+ Hits         7194    7298   +104     
- Misses        621     622     +1     

from pytorch_lightning.metrics.utils import METRIC_EPS


class Fbeta(Metric):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
class Fbeta(Metric):
class FBeta(Metric):

@@ -17,3 +20,31 @@ def dim_zero_mean(x):

def _flatten(x):
return [item for sublist in x for item in sublist]


def to_onehot(
Copy link
Member

Choose a reason for hiding this comment

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

this is already in functional/classification

from tests.metrics.utils import compute_batch, setup_ddp
from tests.metrics.utils import THRESHOLD

from tests.metrics.classification.utils import (
Copy link
Member

Choose a reason for hiding this comment

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

nice 👍
maybe include in the function name that these functions are meant for testing
like _testing_inputs_binary_prob

@mergify mergify bot requested a review from a team October 10, 2020 08:49
@mergify mergify bot requested a review from a team October 10, 2020 09:13
@Borda Borda added the feature Is an improvement or enhancement label Oct 10, 2020
@Borda Borda added this to the 1.0 milestone Oct 10, 2020
ananyahjha93 and others added 7 commits October 10, 2020 11:57
Co-authored-by: Teddy Koker <teddy.koker@gmail.com>
Co-authored-by: Teddy Koker <teddy.koker@gmail.com>
Co-authored-by: Teddy Koker <teddy.koker@gmail.com>
@williamFalcon williamFalcon merged commit ae87724 into master Oct 10, 2020
@Borda Borda mentioned this pull request Oct 10, 2020
@Borda Borda deleted the metrics/classification branch October 13, 2020 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Is an improvement or enhancement refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants