Recommender Systems - Vectorization: Low rank matrix factorization

In this class, we'll talk about following 2 things:

  1. Vectorization of the Collaborative filtering algorithm
  2. One user has recently been looking at one product, can you find other products that are related to this so that you could recommend to the user

Vectorization

Figure-1

Let's work out an alternative way of writing out the predictions of the Collaborative filtering algorithm. Above in figure-1 is our data set. I'll take all the ratings by all the users and group them into a matrix. We have five movies (n_{m}=5) and four users(n_{u}=4). So the matrix Y is 5\times4. The (i,j) element of this matrix is the rating to movie i by user j.

Figure-2

Given the matrix Y of all the ratings, we have an alternative way of writing out all the predictive ratings of the algorithm as Figure-2. In particular, what user j predicts on movie i is given by (\theta ^{(j)})^{T}x^{(i)}. For example, (\theta ^{(1)})^{T}x^{(1)} means the predictive rating to movie one by user one, and so on. Also, in figure-2, we have shown pairs of real ratings and predictive ratings in different colors.

Now, given this matrix of predictive ratings, there is a simpler or vectorized way.

Figure-3

As what can be seen in figure-3, define the matrix X by taking all the features of my movies and stack them in rows. And define matrix \Theta by taking each of the per user parameter vector, and also stack them in rows. Then we have:

Y=X\Theta ^{T}

So, we can give the Collaborative filtering algorithm another name: low rank matrix factorization.

Product recommendation

Figure-4

Having run above Collaborative filtering algorithm or low rank matrix factorization, you can use the learned features to find related movies or products. Specifically, for each product or movie i, we learned a feature vector x^{(i)}\in \mathbb{R}^{n}. Maybe you end up with a feature x_{1}, x_{2},...,x_{n} as figure-4.

Note that after you have learned features, it's actually pretty difficult to go in to the learned features and come up with a human understandable interpretation of what these features really are. But in practice, usually it will learn features that are very meaningful for capturing whatever are the most important or the most salient properties of a movie/product that causes users to like or dislike it.

Now, let's say we want to address the following problem:

Say you have some specific movie i, how to find movies j related to that movie?

Fot this, we can find movie j, so that the distance between feature vectors of movie i and j is small:

\left \| x^{(i)}-x^{(j)} \right \| \rightarrow small

This is a pretty strong indication that movie i and j are somehow similar. Then someone like movie i maybe like movie j as well.

One specific example: if your user is looking at some movie i and if you want to find the 5 most similar movies to that movie in order to recommend 5 new movies to them, what you do is find the 5 movies j with the smallest distance between the features of these movies.

<end>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值