recbole.utils.case_study

recbole.utils.case_study.full_sort_scores(uid_series, model, test_data)[source]

Calculate the scores of all items for each user in uid_series.

Note

The score of [pad] and history items will be set into -inf.

Parameters
Returns

the scores of all items for each user in uid_series.

Return type

torch.Tensor

recbole.utils.case_study.full_sort_topk(uid_series, model, test_data, k)[source]

Calculate the top-k items’ scores and ids for each user in uid_series.

Parameters
Returns

  • topk_scores (torch.Tensor): The scores of topk items.

  • topk_index (torch.Tensor): The index of topk items, which is also the internal ids of items.

Return type

tuple