Open elias-ramzi opened 3 years ago
Hmm, I can't think of an easy way to implement this. Perhaps the design can be improved.
My first thought was to use multiple label per sample (one for each level of the hierarchy tree) to compute the relevance for the NDCG. But in
GlobalEmbeddingSpaceTester
only a single label is kept, so in theAccuracyCalculator
I do not have access to multi-labels.
Given that AccuracyCalculator can operate on 2d labels, it would make sense for GlobalEmbeddingSpaceTester to allow this.
I also want to keep the other metrics (eg. mAP@R) so I don't think I can pass a custom
label_comparison_fn
?
AccuracyCalculator could take some init argument that tells it which label dim each metric should use.
Thanks for the response !
I will think of a way to do that. If I find a not too hacky way of doing that I will submit a PR.
Including a change to the GlobalEmbeddingSpaceTester, allowing to pass 2d labels to the AccuracyCalculator.
Given that AccuracyCalculator can operate on 2d labels, it would make sense for GlobalEmbeddingSpaceTester to allow this.
And a more modular use of the hierarchy level in the AccuracyCalculator.
AccuracyCalculator could take some init argument that tells it which label dim each metric should use.
Hi Kevin,
I am looking to add the Normalized Discounted Cumulative Gain (NDCG) metric to the
AccuracyCalculator
while also using theGlobalEmbeddingSpaceTester
.The NDCG allows the use of non binary similarity labels in contrast to other metrics already implemented in the
AccuracyCalculator
.In my case I want to compute the NDCG for a dataset with labels belonging to a Hierarchical tree (eg. Stanford Online Products).
My first thought was to use multiple label per sample (one for each level of the hierarchy tree) to compute the relevance for the NDCG. But in
GlobalEmbeddingSpaceTester
only a single label is kept, so in theAccuracyCalculator
I do not have access to multi-labels.I also want to keep the other metrics (eg. mAP@R) so I don't think I can pass a custom
label_comparison_fn
?Do you see an easier way to compute the NDCG ?
Thanks for any tips !