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

Fix false num_classes warning in metrics #2781

Merged
merged 2 commits into from
Aug 2, 2020
Merged

Fix false num_classes warning in metrics #2781

merged 2 commits into from
Aug 2, 2020

Conversation

pwwang
Copy link
Contributor

@pwwang pwwang commented Jul 31, 2020

What does this PR do?

Put to_categorical before get_num_classes in metrics/functional/classification.py, which fixes false warning about num_classes.

Fixes #2768

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.
  • (no need) Did you make sure to update the documentation with your changes?
  • (no need) Did you write any new necessary tests?
  • (no need) Did you verify new and existing tests pass locally with your changes?
  • (no need) 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 🙃

@pep8speaks
Copy link

pep8speaks commented Jul 31, 2020

Hello @pwwang! Thanks for updating this PR.

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

Comment last updated at 2020-07-31 22:05:11 UTC

@mergify mergify bot requested a review from a team July 31, 2020 17:38
@pwwang pwwang changed the title Fix num_classes warning in metrics Fix false num_classes warning in metrics Jul 31, 2020
pwwang added 2 commits July 31, 2020 17:46
Put to_categorical before get_num_classes in metrics/functional/classification.py
Remove whitespaces in blank line.
@edenlightning
Copy link
Contributor

Can you fix failing CIs?

@Borda
Copy link
Member

Borda commented Jul 31, 2020

Can you fix failing CIs?

@pwwang mind rebase on master, these issues have been fixed today on master :]
or @ananyahjha93 will rebasing it

@Borda Borda added bug Something isn't working Metrics labels Jul 31, 2020
@mergify mergify bot requested a review from a team July 31, 2020 22:20
@mergify mergify bot requested a review from a team July 31, 2020 22:21
@codecov
Copy link

codecov bot commented Jul 31, 2020

Codecov Report

Merging #2781 into master will decrease coverage by 4%.
The diff coverage is 100%.

@@           Coverage Diff           @@
##           master   #2781    +/-   ##
=======================================
- Coverage      91%     86%    -4%     
=======================================
  Files          76      76            
  Lines        6787    6787            
=======================================
- Hits         6150    5863   -287     
- Misses        637     924   +287     

@Borda
Copy link
Member

Borda commented Jul 31, 2020

Codecov Report

Merging #2781 into master will decrease coverage by 4%.
The diff coverage is 100%.

@@           Coverage Diff           @@
##           master   #2781    +/-   ##
=======================================
- Coverage      91%     86%    -4%     
=======================================
  Files          76      76            
  Lines        6787    6787            
=======================================
- Hits         6150    5863   -287     
- Misses        637     924   +287     

this is strange, it speaks the stats even the condition of waiting for all 22 builds is not fulfill, just checked codecov and it has only 18 builds and still, it speaks...
cc: @awaelchli @williamFalcon

@williamFalcon williamFalcon merged commit c600ca6 into Lightning-AI:master Aug 2, 2020
Diuven pushed a commit to Diuven/pytorch-lightning that referenced this pull request Aug 3, 2020
Borda added a commit that referenced this pull request Aug 6, 2020
* Faster classfication stats

* Faster accuracy metric

* minor change on cls metric

* Add out-of-bound class clamping

* Add more tests and minor fixes

* Resolve code style warning

* Update for #2781

* hotfix

* Update pytorch_lightning/metrics/functional/classification.py

Co-authored-by: Jirka Borovec <[email protected]>

* Update about conversation

* Add docstring on stat_scores_multiple_classes

Co-authored-by: Younghun Roh <[email protected]>
Co-authored-by: Jirka Borovec <[email protected]>
williamFalcon pushed a commit that referenced this pull request Aug 8, 2020
* Faster classfication stats

* Faster accuracy metric

* minor change on cls metric

* Add out-of-bound class clamping

* Add more tests and minor fixes

* Resolve code style warning

* Update for #2781

* hotfix

* Update pytorch_lightning/metrics/functional/classification.py

Co-authored-by: Jirka Borovec <[email protected]>

* Update about conversation

* Add docstring on stat_scores_multiple_classes

* Fixing #2862

Co-authored-by: Younghun Roh <[email protected]>
Co-authored-by: Jirka Borovec <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

to_categorical should go before get_num_classes in metrics/functional/classification.py
6 participants