In this class, we'll talk about an approach to build a recommender system that's called collaborative filtering. This algorithm has a very interesting property that it does what is called feature learning. By that I mean it can start to learn for itself what features to use.
Problem motivation
Previously, as what shown in figure-1, we assumed that for each movie someone had come and told us how romantic that movie was and how much action there was in that movie. But actually it can be very difficult and time consuming to try to get someone to watch each movie and tell you these info. And often you'll need even more features than just these two. So where do you get these features from?
So, as figure-2, let's change the problem a bit and suppose we don't know the values of these features. Instead let's say we've gone through each of our users and each one has told us how much they like the romantic movies and how much they like action packed movies. For example, means Alice told us she really likes romantic movies and so there is a "5" associated with feature "" there. And she really doesn't like action movies, so there's a "0" for "" there. Similarly for other users Bob, Carol, and Dave. In general, we can go to our users and each user told us what is the value of for them, then we can infer the value of the features of and for each movie.
For example, for the first movie "Love at last" which associated with feature vector . Let's ignore its title and pretend we don't know what this movie is about. Because:
- Both Alice and Bob rated it 5 and they told us they like romantic movies
- Both Carol and Dave rated it 0 and they like action movies and hate romantic movies
We might reasonably conclude that this is probably a romantic movie. Thus it's possible that and
This example is mathematically simplified. What we're really asking is what feature vector should be so that
Similarly:
From above, we can infer that
Similarly, we can infer values for feature vectors of other movies.
Optimization algorithm
Let's say our users have given us their preferences as . We can pose the above optimization problem to estimate which is the feature for movie . We want to sum over all the indices for which we have a rating for movie and try to choose feature to minimize the regularized cost function in figure-3. This is how we would learn the features for one specific movie.
To learn all the features for all the movies, we'll sum over all the movies and minimize the objective cost function in figure-4. You end up with a reasonable set of features for all the movies.
Collaborative filtering
In last class, if we have a set of movie ratings (), then given features of different movies (, ), we can learn the parameters which are the preference of different users. What we've shown earlier in this class is that if users are willing to give us parameters , then we can estimate features , for different movies. So, this is kind of a chicken and egg problem.
Then what we can do is:
- Randomly guess some initial value of
- Predict the features for different movies
- Then based on these in step 2, we can then get even better
- Then based on better , we can get bettern again
- Keep on iterating above and going back and forth.
It proved that this actually works and will cause your algorithm to converge to a reasonable set of features for your movies and a reasonable set of parameters for your users. This is a basic collaborative filtering algorithm. We'll be able to improve this later to make it quite a bit more computationally efficient. But hopefully this gives you a sense of how you can formulate a problem where you can simultaneously learn the parameters of different users and the features of different movies.
The term collaborative filtering refers to the observation that when you run this algorithm with a large set of users, what all of these users are effectively doing are sort of collaborating to get better movie ratings for everyone because for every user rating some subset of the movies, every user is helping the algorithm a little bit to learn better features, and then by rating a few movies myself, I will be helping the system learn better features, and these features can be used by the system to make better movie prediction for everyone else. So there is a sense of collaboration where every user is helping the system learn better features for the common good. This is the collaborative filtering.
Next, we'll try to develop an even bettern technique for collaborative filtering.
<end>