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

Cannot get MovieLens labels' correctly #682

Open
baibai25 opened this issue Mar 23, 2023 · 2 comments
Open

Cannot get MovieLens labels' correctly #682

baibai25 opened this issue Mar 23, 2023 · 2 comments

Comments

@baibai25
Copy link

baibai25 commented Mar 23, 2023

Hi!
Thank you for fix #676!
I updated to version 1.17 and tried the tutorial code with the following results.

スクリーンショット 2023-03-23 21 43 28

The label dtype is '<U1', which appears to be incorrect.
I ran movielens.py on my Notebook and got the same result.

スクリーンショット 2023-03-23 21 44 02

Suggestion

Probably an error caused by the numpy specification.
I suggest following modifications:

id_feature_labels = np.empty(num_items, dtype=str)

# new
id_feature_labels = np.empty(num_items, dtype=object)

In my Notebook, it works!

スクリーンショット 2023-03-23 21 44 14

@baibai25
Copy link
Author

Here is my environment

- OS: Ubuntu 20.04.1
- Python: 3.9.2
  - numpy: 1.24.2
  - lightfm: 1.17

@z2z63
Copy link

z2z63 commented Jul 22, 2023

the same problem, and changing from

 id_feature_labels = np.empty(num_items, dtype=str) 

to

 id_feature_labels = np.empty(num_items, dtype=object) 

works

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