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

Update metrics to use Enum (#5657) #5689

Conversation

yuntai
Copy link
Contributor

@yuntai yuntai commented Jan 28, 2021

Add enum in metrics/classification/helpers.py

  • DataType
  • AverageMethod
  • MDMCAverageMethod

What does this PR do?

Fixes # (5657) <- Update metrics to use Enum #5657

Before submitting

  • Was this discussed/approved via a GitHub issue? (not for typos and docs)
  • 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?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or internal minor changes/refactorings)

PR review

Anyone in the community is free to review the PR once the tests have passed.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:

  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified
  • Check that target branch and milestone match!

Did you have fun?

Make sure you had fun coding 🙃

@pep8speaks
Copy link

pep8speaks commented Jan 28, 2021

Hello @yuntai! Thanks for updating this PR.

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

Comment last updated at 2021-02-01 17:22:28 UTC

Copy link
Member

@justusschock justusschock left a comment

Choose a reason for hiding this comment

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

I like it.

@yuntai yuntai force-pushed the feature/5657_update_metrics_to_use_enum branch from fd78e1f to 514a804 Compare January 28, 2021 09:17
@SkafteNicki
Copy link
Member

@Borda Borda added feature Is an improvement or enhancement Metrics labels Jan 28, 2021
@Borda Borda added this to the 1.2 milestone Jan 28, 2021
@Borda Borda changed the base branch from master to release/1.2-dev January 28, 2021 09:29
@Borda Borda force-pushed the feature/5657_update_metrics_to_use_enum branch from 514a804 to 3504fa8 Compare January 28, 2021 09:37
@mergify mergify bot removed the has conflicts label Jan 28, 2021
@Borda Borda force-pushed the feature/5657_update_metrics_to_use_enum branch from 3504fa8 to 0947c44 Compare January 28, 2021 09:38
@codecov
Copy link

codecov bot commented Jan 28, 2021

Codecov Report

Merging #5689 (7c77ab3) into release/1.2-dev (5d239cc) will decrease coverage by 5%.
The diff coverage is 100%.

@@               Coverage Diff                @@
##           release/1.2-dev   #5689    +/-   ##
================================================
- Coverage               89%     84%    -5%     
================================================
  Files                  169     169            
  Lines                12415   12430    +15     
================================================
- Hits                 11099   10479   -620     
- Misses                1316    1951   +635     

@yuntai yuntai force-pushed the feature/5657_update_metrics_to_use_enum branch from 0947c44 to 211dfea Compare January 28, 2021 09:59
@yuntai
Copy link
Contributor Author

yuntai commented Jan 28, 2021

@SkafteNicki added class AverageMethod and class MDMCAverageMethod in helpers.py and remove AverageMethods from functional/auroc.py

do we want NormalizationMethod for confusion matrix as well?

@yuntai yuntai changed the title Update metrics to use Enum (#5657) Update metrics to use Enum [WIP] (#5657) Jan 28, 2021
@yuntai yuntai force-pushed the feature/5657_update_metrics_to_use_enum branch 2 times, most recently from abac809 to ce1e528 Compare January 28, 2021 14:55
@yuntai yuntai changed the title Update metrics to use Enum [WIP] (#5657) Update metrics to use Enum (#5657) Jan 28, 2021
@justusschock
Copy link
Member

@yuntai if this is only used in the confusion matrix, this is probably overkill.

@yuntai yuntai force-pushed the feature/5657_update_metrics_to_use_enum branch from 481faec to 52e8069 Compare January 28, 2021 15:22
@SkafteNicki
Copy link
Member

@yuntai as @justusschock mentions it is probably overkill. I would say that we should only convert code that atleast influences two metrics.

@yuntai yuntai force-pushed the feature/5657_update_metrics_to_use_enum branch 2 times, most recently from 6345a6d to 517db08 Compare January 29, 2021 15:38
@yuntai yuntai closed this Jan 30, 2021
@yuntai yuntai reopened this Jan 30, 2021
@yuntai yuntai force-pushed the feature/5657_update_metrics_to_use_enum branch from 517db08 to 17737f8 Compare January 31, 2021 02:25
@mergify mergify bot removed the has conflicts label Jan 31, 2021
- Add DataType, AverageMethod and MDMCAverageMethod
@yuntai yuntai force-pushed the feature/5657_update_metrics_to_use_enum branch from 17737f8 to 727e289 Compare January 31, 2021 02:37
Copy link
Member

@SkafteNicki SkafteNicki left a comment

Choose a reason for hiding this comment

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

LGTM :]

@SkafteNicki SkafteNicki requested a review from Borda February 1, 2021 13:39
@Borda Borda enabled auto-merge (squash) February 1, 2021 13:59
@Borda Borda disabled auto-merge February 1, 2021 13:59
@Borda Borda enabled auto-merge (squash) February 1, 2021 14:00
@Borda Borda added the ready PRs ready to be merged label Feb 1, 2021
Co-authored-by: Nicki Skafte <[email protected]>
@Borda Borda merged commit 50fd487 into Lightning-AI:release/1.2-dev Feb 1, 2021
@yuntai yuntai deleted the feature/5657_update_metrics_to_use_enum branch February 2, 2021 09:36
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 ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants