Machine Learning第九讲[推荐系统] --(一)基于内容的推荐系统

内容来自Andrew老师课程Machine Learning的第九章内容的Predicting Movie Ratings部分。


先介绍本篇博文需要用到的字母及其含义:
  • Machine Learning第九讲[推荐系统] --(一)基于内容的推荐系统: no. of users
  • Machine Learning第九讲[推荐系统] --(一)基于内容的推荐系统: no. of movies
  • r(i, j)=1: if user j has rated movie i 
  • Machine Learning第九讲[推荐系统] --(一)基于内容的推荐系统: rating given by user j to movie i ( defined only if r(i, j)=1 )
  • Machine Learning第九讲[推荐系统] --(一)基于内容的推荐系统: parameter vector for user j
  • Machine Learning第九讲[推荐系统] --(一)基于内容的推荐系统: feature vector for movie i
  • Machine Learning第九讲[推荐系统] --(一)基于内容的推荐系统: no. of movies rated by user j
来看下面的例子:
Movie Alice(1) Bob(2) Carol(3) Dave(4) x1
(romance)
x2
(action)
Machine Learning第九讲[推荐系统] --(一)基于内容的推荐系统:Love at last 5 5 0 0 0.9 0
Machine Learning第九讲[推荐系统] --(一)基于内容的推荐系统:Romance forever 5 ? ? 0 1.0 0.01
Machine Learning第九讲[推荐系统] --(一)基于内容的推荐系统:Cute pupies of love ? 4 0 ? 0.99 0
Machine Learning第九讲[推荐系统] --(一)基于内容的推荐系统:Nonstop car chases 0 0 5 4 0.1 1.0
Machine Learning第九讲[推荐系统] --(一)基于内容的推荐系统:Swaord vs. karate 0 0 5 ? 0 0.9

对于每一个用户j,假设我们已经通过学习找到参数Machine Learning第九讲[推荐系统] --(一)基于内容的推荐系统,则用户j对电影i的评分预测值为:Machine Learning第九讲[推荐系统] --(一)基于内容的推荐系统

对于上面的例子:

Machine Learning第九讲[推荐系统] --(一)基于内容的推荐系统
假设已知:
Machine Learning第九讲[推荐系统] --(一)基于内容的推荐系统
则Alice(j=1)对Cute pupies of love(i=3)的评分将被预测为:
Machine Learning第九讲[推荐系统] --(一)基于内容的推荐系统

下面我们来看怎么来求θ值:
Machine Learning第九讲[推荐系统] --(一)基于内容的推荐系统
这个公式其实是线性回归的变种,它和线性回归有很多相似的样子,其思路也很相似,代价函数都是预测值和实际值的差值平方和。