-
-
Notifications
You must be signed in to change notification settings - Fork 388
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
Recsys map #968
Recsys map #968
Conversation
catalyst/metrics/avg_precision.py
Outdated
Calculate the Average Precision (AP) for recsys | ||
The precision metric summarizes the fraction of relevant items | ||
out of the whole the recommendation list. | ||
The average precision @ k (AP@k) metrics summarizes the average |
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.
maybe, this could help a bit https://stackoverflow.com/questions/45534757/how-to-use-inline-code-with-a-trailing-whitespace
catalyst/metrics/avg_precision.py
Outdated
|
||
|
||
def avg_precision( | ||
outputs: torch.Tensor, targets: torch.Tensor, k=100 |
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.
k=10
?
@@ -0,0 +1,64 @@ | |||
import numpy as np |
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.
could we also add tests from recsys course?
) / float(index + 1) | ||
|
||
ap = torch.mean(precisions, dim=1) | ||
return ap |
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.
could we add docs, that we return Tensor with shape [bs]
?
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.
and could we also add mean_avg_precision
metric here?
Pull request has been modified.
Pull request has been modified.
catalyst/metrics/ndcg.py
Outdated
import torch | ||
|
||
|
||
def dcg( |
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.
not sure if we need it here :)
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.
extra spaces or dcg
method?
catalyst/metrics/tests/test_ndcg.py
Outdated
|
||
import numpy as np | ||
|
||
import torch |
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.
and this one :)
Pull request has been modified.
This pull request is now in conflicts. @zkid18, could you fix it? 🙏 |
Before submitting
catalyst-make-codestyle && catalyst-check-codestyle
(pip install -U catalyst-codestyle
).make check-docs
?pytest .
?Description
Related Issue
Type of Change
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.
PS