jma127 / pyltr

Python learning to rank (LTR) toolkit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: only integer scalar arrays can be converted to a scalar index

senjed opened this issue · comments

Hi, I am using the same code as provided in Readme.txt with a different data and I keep getting this error. Spend a lot of time fixing it but no luck. Do you have any idea what might have caused it?

File "somefile.py", line 691, in ltr
print 'Our model:', metric.calc_mean(Eqids, Ey, Epred)
File "/anaconda2/lib/python2.7/site-packages/pyltr-0.2.4-py2.7.egg/pyltr/metrics/_metrics.py", line 157, in calc_mean
for qid, a, b in query_groups])
File "/anaconda2/lib/python2.7/site-packages/pyltr-0.2.4-py2.7.egg/pyltr/metrics/_metrics.py", line 108, in evaluate_preds
return self.evaluate(qid, get_sorted_y(targets, preds))
File "/anaconda2/lib/python2.7/site-packages/pyltr-0.2.4-py2.7.egg/pyltr/util/sort.py", line 36, in get_sorted_y
return y[get_sorted_y_positions(y, y_pred, check=check)]
TypeError: only integer scalar arrays can be converted to a scalar index

I'm having the same issue, did you figure out what the error was?