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

Support multioutput pearson and spearman corrcoef #1200

Merged
merged 27 commits into from
Sep 22, 2022

Conversation

SkafteNicki
Copy link
Member

@SkafteNicki SkafteNicki commented Aug 30, 2022

What does this PR do?

Fixes #1177
Adds support in spearman and pearson correlation coefficient metrics for 2d arrays (multioutput).

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 to update the docs?
  • Did you write any new necessary tests?

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 🙃

@SkafteNicki SkafteNicki added the enhancement New feature or request label Aug 30, 2022
@SkafteNicki SkafteNicki added this to the v0.10 milestone Aug 30, 2022
@SkafteNicki SkafteNicki changed the title Feature/2d pearson spearman Support multioutput pearson and spearman corrcoef Aug 30, 2022
Borda
Borda previously approved these changes Sep 5, 2022
@Borda Borda self-requested a review September 5, 2022 19:26
@Borda
Copy link
Member

Borda commented Sep 5, 2022

Seems that the assertion comparison fails...

@Borda Borda dismissed their stale review September 5, 2022 19:28

tests are failing

@codecov
Copy link

codecov bot commented Sep 8, 2022

Codecov Report

Merging #1200 (1f248e7) into master (a1938ea) will decrease coverage by 50%.
The diff coverage is 95%.

Additional details and impacted files
@@           Coverage Diff            @@
##           master   #1200     +/-   ##
========================================
- Coverage      86%     36%    -50%     
========================================
  Files         191     191             
  Lines       11332   11342     +10     
========================================
- Hits         9709    4028   -5681     
- Misses       1623    7314   +5691     

@mergify mergify bot removed the has conflicts label Sep 14, 2022
Copy link
Member

@Borda Borda left a comment

Choose a reason for hiding this comment

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

Shall we also get tests that exceptions are raised for wrong configurations?

src/torchmetrics/functional/regression/pearson.py Outdated Show resolved Hide resolved
src/torchmetrics/functional/regression/pearson.py Outdated Show resolved Hide resolved
src/torchmetrics/functional/regression/spearman.py Outdated Show resolved Hide resolved
src/torchmetrics/functional/regression/spearman.py Outdated Show resolved Hide resolved
SkafteNicki and others added 3 commits September 16, 2022 10:20
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
@azure-pipelines
Copy link

There was an error handling pipeline event 731315bb-5dfe-468e-bdd2-706997066433.

@SkafteNicki
Copy link
Member Author

Shall we also get tests that exceptions are raised for wrong configurations?

They are already there:
https://github.com/Lightning-AI/metrics/blob/80e0f292fde68fcfcfe0f9b8f8ad16e5a98bb1f3/tests/unittests/regression/test_pearson.py#L111-L122

@Borda Borda enabled auto-merge (squash) September 16, 2022 08:31
@mergify mergify bot added the ready label Sep 16, 2022
@Borda
Copy link
Member

Borda commented Sep 16, 2022

@justusschock @stancld mind have look ^^ 🦦

Copy link
Contributor

@stancld stancld left a comment

Choose a reason for hiding this comment

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

I have only some minor comments -- I'm a bit worried the error message raised wouldn't be clear.

src/torchmetrics/functional/regression/pearson.py Outdated Show resolved Hide resolved
src/torchmetrics/functional/regression/spearman.py Outdated Show resolved Hide resolved
tests/unittests/regression/test_spearman.py Outdated Show resolved Hide resolved
@mergify mergify bot removed the has conflicts label Sep 16, 2022
Borda and others added 3 commits September 17, 2022 01:51
Co-authored-by: Daniel Stancl <46073029+stancld@users.noreply.github.com>
@SkafteNicki SkafteNicki requested a review from stancld September 22, 2022 12:37
@Borda
Copy link
Member

Borda commented Sep 22, 2022

@justusschock pls ^^

@mergify mergify bot removed the ready label Sep 22, 2022
@mergify mergify bot added the ready label Sep 22, 2022
Copy link
Contributor

@stancld stancld left a comment

Choose a reason for hiding this comment

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

👍

@Borda Borda merged commit 460aae3 into master Sep 22, 2022
@Borda Borda deleted the feature/2d_pearson_spearman branch September 22, 2022 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for 2D tensors for pearson and spearman correlations
3 participants