You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds the step-by-step Jupyter notebook tutorial for the NDCG metric.
It creates the ndcg-metric-tutorial.ipynb file in the tutorials/intermediate/ directory, as discussed with @vfdev-5. This notebook demonstrates how to effectively use the metric for ranking evaluations and will serve as the destination link for the docstring update in the main pytorch-ignite repository.
Type of Change
New tutorial / documentation
Checklist
The Jupyter notebook runs successfully from top to bottom without errors.
@steaphenai
I think we should make a function for calculating the dcg score.
For the case for calculating the ideal dcg we can just call the function and send y_true in both parameters, true labels and predicted like dcg(y_true, y_true, k)
It wll have 2 benefits:
No repeated code.
User just needs to understand the dcg function once.
currently you are writing 2 loops for doing same thing twice, and the loop style in both case is different .
@steaphenai I think we should make a function for calculating the dcg score.
For the case for calculating the ideal dcg we can just call the function and send y_true in both parameters, true labels and predicted like dcg(y_true, y_true, k)
It wll have 2 benefits:
No repeated code.
User just needs to understand the dcg function once.
currently you are writing 2 loops for doing same thing twice, and the loop style in both case is different .
Yes, I Refactored into a single compute_dcg function and call it for both DCG and IDCG and made the necessary changes. Thanks!
looks fine, but I think sorting of scores could be included in dcg method itself, compute_dcg(y_true,y_pred,k) for sorting according to the y_pred, and to get ideal score compute_dcg(y_true,y_true,k), which sorts according to the y_true.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Docs: #93
Description
This PR adds the step-by-step Jupyter notebook tutorial for the NDCG metric.
It creates the
ndcg-metric-tutorial.ipynbfile in thetutorials/intermediate/directory, as discussed with @vfdev-5. This notebook demonstrates how to effectively use the metric for ranking evaluations and will serve as the destination link for the docstring update in the mainpytorch-igniterepository.Type of Change
Checklist