Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mahout: how to make recommendations for new users

Tags:

svd

mahout

We plan to use Mahout for a movie recommendation system. And we also plan to use SVD for model building.

When a new user comes we will require him/her to rate a certain number of movies (say 10).

The problem is that, in order to make a recommendation to this new user we have to rebuild the entire model again.

Is there a better way to this?

Thanks

like image 821
Ahmet Yılmaz Avatar asked Oct 12 '12 11:10

Ahmet Yılmaz


People also ask

What is the recommendation system in used in Mahout?

Recommendation • Mahout implements a Collaborative Filtering framework – Popularized by Amazon and others – Uses hystorical data (ratings, clicks, and purchases) to provide recommendations • User-based: Recommend items by finding similar users.


1 Answers

Yes... though not in Mahout. The implementations there are by nature built around periodic reloading and rebuilding of a data model. In some implementations this still lets you use new data on the fly, like neighborhood-based implementations. I don't think the SVD-based in-memory one does this (I didn't write it.)

In theory, you can start making recommendations from the very first click or rating, by projecting the target item/movie back into the user-feature space via fold-in. To greatly simplify -- if your rank-k approximate factorization of input A is Ak = Uk * Sk * Vk', then for a new user u, you want a new row Uk_u for your update. You have A_u.

Uk = Ak * (Vk')^-1 * (Sk)^-1. The good news is that those two inverses on the right are trivial. (Vk')^-1 = Vk because it has orthonormal columns. (Sk)^-1 is just a matter of taking the reciprocal of Sk's diagonal elements.

So Uk_u = Ak_u * (Vk')^-1 * (Sk)^-1. You don't have Ak_u, but, you have A_u which is approximately the same, so you use that.

If you like Mahout, and like matrix factorization, I suggest you consider the ALS algorithm. It's a simpler process, so is faster (but makes the fold-in a little harder -- see the end of a recent explanation I gave). It works nicely for recommendations.

This also exists in Mahout, though the fold-in isn't implemented. Myrrix, which is where I am continuing work from Mahout, implements all of this.

like image 142
Sean Owen Avatar answered Sep 24 '22 04:09

Sean Owen