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

userid and itemid start from 1 #164

Open
KylinA1 opened this issue Jun 12, 2019 · 3 comments
Open

userid and itemid start from 1 #164

KylinA1 opened this issue Jun 12, 2019 · 3 comments

Comments

@KylinA1
Copy link

KylinA1 commented Jun 12, 2019

Hello,

I just notice that you start count id from 1, which lead to one more dimension abuse in both user and item.
For example, the number of user and item in Movielens 1M is 6040 and 3706.
Actually, your final processed dataset , including Scipy matrix is in 6041*3707 shape.

This might be a tiny problem.

@snemistry
Copy link

For sequence models, 0 item id is reserve as padding. That's why.

@KylinA1
Copy link
Author

KylinA1 commented Sep 6, 2019

Thanks fur your kind replies, that make sense.

@BBiering
Copy link

It seems a bit weird that user ids are implicitly assumed to start from 1 until N, with N = num users since 0 is reserved for padding but it raises an error if num_users = user_ids.max(). Same goes for item ids. Or have I missed something?

See spotlight/interactions.py at line 129:
if self.user_ids.max() >= self.num_users: raise ValueError('Maximum user id greater ' 'than declared number of users.')

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

3 participants