implicit icon indicating copy to clipboard operation
implicit copied to clipboard

getting index error while using recommend function while ALS algorithm

Open abhinav221294 opened this issue 2 years ago • 4 comments

model.recommend(user_label, sparse_user_items[user_label])


IndexError Traceback (most recent call last) Cell In[33], line 1 ----> 1 model.recommend(user_label, sparse_user_items[user_label])

File ~\anaconda3\Lib\site-packages\implicit\cpu\matrix_factorization_base.py:79, in MatrixFactorizationBase.recommend(self, userid, user_items, N, filter_already_liked_items, filter_items, recalculate_user, items) 76 if items is not None: 77 filter_query_items = _filter_items_from_sparse_matrix(items, filter_query_items) ---> 79 ids, scores = topk( 80 item_factors, 81 user, 82 N, 83 filter_query_items=filter_query_items, 84 filter_items=filter_items, 85 num_threads=self.num_threads, 86 ) 88 if np.isscalar(userid): 89 ids, scores = ids[0], scores[0]

File topk.pyx:32, in implicit.cpu.topk.topk()

File topk.pyx:54, in implicit.cpu.topk._topk_batch()

IndexError: index 977 is out of bounds for axis 1 with size 944

for the reference: https://github.com/benfred/implicit/issues/535

abhinav221294 avatar Feb 22 '24 18:02 abhinav221294

Same issue here

mandanafasounaki avatar Nov 19 '24 11:11 mandanafasounaki

Same issue here

reese60525 avatar Dec 18 '24 19:12 reese60525

Same issue here

sjain-ajc avatar Apr 22 '25 02:04 sjain-ajc

Did someone find a solution ? I'm stuck with the same error :(

Lazyyx avatar May 16 '25 18:05 Lazyyx