-
Notifications
You must be signed in to change notification settings - Fork 427
Weighted Pearson, Spearman, and R2 score #1759
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
base: master
Are you sure you want to change the base?
Weighted Pearson, Spearman, and R2 score #1759
Conversation
I’m adding a weighted version of Pearson right now and updated the I tried debugging |
@matsumotosan I have taken care of the testing now, such that inputs gets correctly send to the respective input. |
@matsumotosan @SkafteNicki, how is it going here? Could we have it for the next 1.1 release? |
The docstring for |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
* fix * changelog
6a8603b
to
e2e800f
Compare
for more information, see https://pre-commit.ci
@matsumotosan run rebase from master so pls check if I resolved all conflict property... |
if cond: | ||
mx_new = (n_prior * mean_x + preds.sum(0)) / (n_prior + n_obs) | ||
my_new = (n_prior * mean_y + target.sum(0)) / (n_prior + n_obs) | ||
if weights is None: | ||
mx_new = (n_prior * mean_x + preds.sum(0)) / (n_prior + n_obs) | ||
my_new = (n_prior * mean_y + target.sum(0)) / (n_prior + n_obs) | ||
else: | ||
mx_new = (n_prior * mean_x + torch.matmul(weights, preds)) / (n_prior + n_obs) | ||
my_new = (n_prior * mean_y + torch.matmul(weights, target)) / (n_prior + n_obs) | ||
else: | ||
mx_new = preds.mean(0) | ||
my_new = target.mean(0) | ||
if weights is None: | ||
mx_new = preds.mean(0) | ||
my_new = target.mean(0) | ||
else: | ||
mx_new = torch.matmul(weights, preds) / weights.sum() | ||
my_new = torch.matmul(weights, target) / weights.sum() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rather have have if weights
is NOne to make it full of ones to have no effect but the code simpler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Borda I think it might be simpler just to have separate functions for weighted and unweighted instead of trying to fit everything into one.
d0a5568
to
9fc79ae
Compare
Hey! Wanted to see if there’s still some work left here since #1235 is still open. |
@matsumotosan, would you mind checking the collisions and remaining comments? 🦩 |
@Borda Taking this back up. |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
4b07b79
to
9f4a001
Compare
What does this PR do?
Fixes #1235
Before submitting
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 🙃