Datasets:

Modalities:
Tabular
Text
Formats:
parquet
ArXiv:
Libraries:
Datasets
pandas
License:

Fix bug of user_ids not sorted in Ranked

#13
by waikng - opened

== Test Case ==

ranked = Ranked(
    user_ids=torch.tensor(
        [3, 1, 2]
    ),
    item_ids=torch.tensor(
        [
            [301, 302, 303],
            [104, 105, 105],
            [207, 208, 209],
        ]
    ),
    scores=torch.tensor(
        [
            [3.3, 3.2, 3.1],
            [1.3, 1.2, 1.1],
            [2.3, 2.2, 1.2],
        ]
    ),  
)
print(ranked)

== Output ==

Ranked(user_ids=tensor([3, 1, 2]), item_ids=tensor([[104, 105, 105],
        [207, 208, 209],
        [301, 302, 303]]), scores=tensor([[1.3000, 1.2000, 1.1000],
        [2.3000, 2.2000, 1.2000],
        [3.3000, 3.2000, 3.1000]]), num_item_ids=None)

user_ids are not sorted.

Yandex org

Thank you for your contribution!

tytskiy changed pull request status to merged

Sign up or log in to comment