Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting index error while using recommend function while ALS algorithm #708

Open
abhinav221294 opened this issue Feb 22, 2024 · 1 comment

Comments

@abhinav221294
Copy link

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: #535

@mandanafasounaki
Copy link

Same issue here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants