wildltr / ptranking

Learning to Rank in PyTorch

Home Page:https://wildltr.github.io/ptranking/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KeyError on LambdaRank Tutorial

rikiachmad opened this issue · comments

I basically follow the exact step with your tutorial on /tutorial/ptranking_demo_ltr.ipynb file. I used the same dataset from LETOR 4.0 MQ2008 but got a KeyError in this line of code lambdarank_losses, lambdarank_train_ndcgs, lambdarank_test_ndcgs = ltr_evaluator.naive_train(ranker=lambdarank, eval_dict=eval_dict, train_data=train_data, test_data=test_data). It was fine with the RankNet though.
Error:

label_type = kwargs['label_type']
     32         assert LABEL_TYPE.MultiLabel == label_type
     33         assert 'presort' in kwargs and kwargs['presort'] is True  # aiming for direct usage of ideal ranking

KeyError: 'label_type'

这里修改一下就OK了
image