lyst / lyst/lightfm

issue on user_ids parameter. This must be either int or np.int32 array. Type received: <class 'numpy.int64'>**

Open
#648 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
5.1k
Forks
724
PR merge metrics
No merged PRs in 30d

Description

May I ask how to resolve this ??
I

recommended_score = self.model.predict(user_code,
np.array(list_item_codes),
user_features=user_features,
item_features=item_features,
num_threads=multiprocessing.cpu_count()
)


--> 144 recommended_score = self.model.predict(user_code,
145 np.array(list_item_codes),
146 user_features=user_features,

c:\Users\\Desktop\ENV\lib\site-packages\lightfm\lightfm.py in predict(self, user_ids, item_ids, item_features, user_features, num_threads)
786
787 if not isinstance(user_ids, np.ndarray):
--> 788 raise TypeError(
789 f"Invalid type passed to user_ids parameter. "
790 **f"This must be either int or np.int32 array. "**

**TypeError: Invalid type passed to user_ids parameter. This must be either int or np.int32 array. Type received: **

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with lightfm.py: predict and the traceback around lines 786-790; reproduce the call using a NumPy int64 user ID and inspect the accepted user_ids types. Determine whether the behavior is expected input handling or a library bug, then define completion with a regression test or clarified usage guidance.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.