ranking icon indicating copy to clipboard operation
ranking copied to clipboard

Mask needs to be used while computing ranking_metrics.

Open Shuailong opened this issue 3 years ago • 2 comments

https://github.com/tensorflow/ranking/blob/94cccec8b4e71d2cc4489c61e2623522738c2924/tensorflow_ranking/python/keras/metrics.py#L186

Seems that currently the ranking metrics does not support the mask argument. Passing the mask argument as sample_weight argument does not work, because when calculating ranks, the 0 padded score will be counted when calculating the ranking of the items in the list, affecting the ranks of other normal items, when negative score is involved. I see a TODO here, is there any plan to support mask in the future?

A related issue is this one.

Shuailong avatar Dec 06 '21 06:12 Shuailong

You can still pass the -1 value in the labels when calling it. Any entries with labels = -1 will be treated as padded ones.

xuanhuiwang avatar Dec 06 '21 19:12 xuanhuiwang

You can still pass the -1 value in the labels when calling it. Any entries with labels = -1 will be treated as padded ones.

Since my labels already have negative values, how will that does not affect the metric calculation (e.g label value-2)? Or it does not support negative relevance?

Shuailong avatar Dec 06 '21 23:12 Shuailong