-
Notifications
You must be signed in to change notification settings - Fork 30
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
Batch NDCG #342
Batch NDCG #342
Conversation
c41e976
to
a26302c
Compare
a26302c
to
198a58e
Compare
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.
We should review the use of plurals vs singulars.
A doubt that has haunted me for years is that why it is preds and target, rather than preds and targets or pred and target. Therefore, I prefer using singular form for all variables except for those concepts that have been accepted by the general public. |
e8e4b67
to
c96657c
Compare
979b865
to
30701c7
Compare
libmultilabel/nn/metrics.py
Outdated
@@ -45,6 +45,7 @@ class NDCG(Metric): | |||
https://scikit-learn.org/stable/modules/generated/sklearn.metrics.ndcg_score.html | |||
Please find the formal definition here: | |||
https://nlp.stanford.edu/IR-book/html/htmledition/evaluation-of-ranked-retrieval-results-1.html | |||
The target has to be a binary tensor. |
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.
add
We do not use NDCG in ?? because of ??
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.
I'm not pretty sure what should be filled in the ??. As Li-Chung only mention this in function-level comments, I will rewrite it and put it under _idcg() to align with Li-Chung's changes and to not confuse anyone.
30701c7
to
b08dd9b
Compare
30c9d54
to
a6b124d
Compare
8c36c4d
to
fb2a71c
Compare
What does this PR do?
The original NDCG metric calculates scores for one instance at a time, which is inefficient. The new NDCG metric calculate scores in batch.
Performance Test Settings:
Number of labels = 100
Batch size = 40
Number of batchs = 100
Effective number of validation samples = 4000
Results:
Test CLI & API (
bash tests/autotest.sh
)Test APIs used by main.py.
Check API Document
If any new APIs are added, please check if the description of the APIs is added to API document.
Test quickstart & API (
bash tests/docs/test_changed_document.sh
)If any APIs in quickstarts or tutorials are modified, please run this test to check if the current examples can run correctly after the modified APIs are released.