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

how can svd in surprise predict ratings for new user or new item that svd does not even know them in the training set #446

Open
AbdElrahmanMostafaRifaat1432 opened this issue Nov 2, 2022 · 4 comments

Comments

@AbdElrahmanMostafaRifaat1432

suppose we have user A and item B

I hope you can clarify how svd can predict ratings for the following 3 cases:

svd.predict(A,B)

1- user A not in the training set but item B is in the training set
2- user A is in the training set but item B is not in the training set
3- user A and item B are not in the training set

Note: I mean by training set is the data that I have trained the svd model on

I wonder how svd can predict for a new user or item that it doesnot even know them

@NicolasHug
Copy link
Owner

You can see details here:

est = self.trainset.global_mean
if known_user:
est += self.bu[u]
if known_item:
est += self.bi[i]
if known_user and known_item:
est += np.dot(self.qi[i], self.pu[u])

1: global mean + item bias
2: global mean + user bias
3: global mean

@AbdElrahmanMostafaRifaat1432
Copy link
Author

first , thank you for the answer

second , I am working now on a graduation project like amazon website so I expect a lot of incoming users and items

is the implementation you showed me effective for this case or is there a way that I can generate the latent factors for the new user or a new item

I hope if you can guide me generally even if surprise does not support the solution you will say

I will appreciate it too much if there is a concept that I can search about for this problem

@NicolasHug
Copy link
Owner

is the implementation you showed me effective for this case

Not really, the mean of all ratings is pretty un-informative when it comes to recommending personalized items.

The problem you're facing is commonly called the "cold start problem". It's a hard problem in general. There are different ways to address it which are mostly out of scope for surprise. Perhaps there are ways that are specific to SVD as well, although I'm not aware of any personally.

Hope this can help your research!

@NicolasHug
Copy link
Owner

Also check this thread: #208. There are forks out there that have tried to tackle this problem in surprise. I haven't checked them in details though

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