17. 关联规则的基本概念 - 支持度 支持度公式: 支持度揭示了 A 和 B 同时出现的频率,如果 A 和 B 一起出现的频率非常小,那么就说明了 A 和 B 之间的联系并不大;但若一起出现的频率非常频繁,那么 A 和 B 总是相关联。
18. 关联规则的基本概念 - 置信度 置信度公式: 置信度揭示了 A 出现时, B 是否一定会出现,如果出现则其大概有多大的可能出现。如果置信度为 100%, 则说明了 A 出现时, B 一定出现。那么,对这种情况而言,假设 A 和 B 是市场上的两种商品,就没有理由不进行捆绑销售了。 如果置信度太低,那么说明 A 和 B 关系并不大 .
39. User-Based 的相似性算法 - 余弦相似性 Similarity between items i & j is computed by isolating the users who have rated them and then applying a similarity computation technique. Cosine-based Similarity – items are vectors in the m dimensional user space (difference in rating scale between users is not taken into account).
40. User-Based 的相似性算法 - 相关相似性 Correlation-based Similarity - using the Pearson-r correlation (used only in cases where the uses rated both item I & item j). R(u,i) = rating of user u on item i. R(i) = average rating of the i-th item.
41. User-Based 的相似性算法 - 修正的余弦相似性 Adjusted Cosine Similarity – each pair in the co-rated set corresponds to a different user. (takes care of difference in rating scale). R(u,i) = rating of user u on item i. R(u) = average of the u-th user.
42. 基于 User-Based 的协同过滤 - 推荐算法 由目标客户的邻居产生 N 件商品推荐,可以采用如下两种不同方法产生推荐 最频繁项目推荐 ( Most-frequent Item Recommendation ) 扫描目标客户每一个邻居的购买数据,对其购买的商品进行计数,选择出现频率最高且目标客户没有购买的前 N 件商品最为推荐结果 基于关联的推荐 ( Association Rule-based Recommendation ) : 类似于基于关联规则的推荐算法,只是将目标客户的邻居作为算法的输入
43. 基于 Item-based 协同过滤算法 基本思路 基本假设:能够引起用户兴趣的项,必定与其之前评分高的相似 根据目标客户已经评价过的项目与目标项目的相似性,选择 k 个最相似的项目 {i 1 , i 2 , ……, i k } ,同时得到 k 个最相似的项目与目标项目的相似度,记为 {s i1 , s i2 , ……, s ik } ,然后将目标客户对这 k 个最相似的项目的评分及这 k 个最相似的项目与目标项目的相似度的加权平均值作为对目标项目的评分 基本步骤 1 )得到 User-item 的评分数据; 2 )针对项的最近邻搜索,即对项进行相似度计算; 3 )产生推荐。
44. 基于 Item-based 协同过滤 - 相似性算法 计算项目 i 和 j 之间的相似性: 从所有的用户中分离出同时对项目 i 和项目 j 进行评价的用户 根据上面得到的数据计算项目 i 和项目 j 的相似性 12/20/09
46. Slope One- 简单高效的推荐算法 基本思路 平均值可以代替某两个未知个体之间的打分差异 例如:事物 A 对事物 B 的平均差是: ((3 - 4) + (2 - 4)) / 2 = -1.5 ,也就是说人们对事物 B 的打分一般比事物 A 的打分要高 1.5 ,于是 Slope one 算法就猜测 Z 对事物 B 的打分是 4 + 1.5 = 5.5
47. Slope One- 简单高效的推荐算法 加权算法 有 n 个人对事物 A 和事物 B 打分了, R(A->B) 表示这 n 个人对 A 和对 B 打分的平均差( A-B ) , 有 m 个人对事物 B 和事物 C 打分了, R ( C->B )表示这 m 个人对 C 和对 B 打分的平均差( C-B ),注意都是平均差而不是平方差,现在某个用户对 A 的打分是 ra ,对 C 的打分是 rc ,那么 A 对 B 的打分可能是: rb = (n * (ra - R(A->B)) + m * (rc - R(C->B)))/(m+n) 参考资料 http://en.wikipedia.org/wiki/Slope_One
48. 协同过滤推荐系统常见问题 Cold Start : There needs to be enough other users already in the system to find a match. Sparsity : If there are many items to be recommended, even if there are many users, the user/ratings matrix is sparse, and it is hard to find users that have rated the same items. First Rater : Cannot recommend an item that has not been previously rated. New items Esoteric items Popularity Bias : Cannot recommend items to someone with unique tastes. Tends to recommend popular items.
50. Vector space model 在向量空间模型中,文本泛指各种机器可读的记录。用 D ( Document )表示,特征项( Term ,用 t 表示)是指出现在文档 D 中且能够代表该文档内容的基本语言单位,主要是由词或者短语构成,文本可以用特征项集表示为 D(T1 , T2 ,…, Tn) ,其中 Tk 是特征项, 1<=k<=N 。 例如一篇文档中有 a 、 b 、 c 、 d 四个特征项,那么这篇文档就可以表示为 D(a , b , c , d) 。对含有 n 个特征项的文本而言,通常会给每个特征项赋予一定的 权重表示其重要程度。即 D = D(T1 , W1 ; T2 , W2 ;…, Tn , Wn) ,简记为 D = D(W1 , W2 ,…, Wn) ,我们把它叫做文本 D 的向量表示。其中 Wk 是 Tk 的权重, 1<=k<=N 。
59. 基于 TF/IDF 算法的商品相关度实现 商品关键内容分词相关度 利用搜索引擎分词法对商品关键内容建立索引,然后利用类似 Lucene 这样的 TF/IDF 相似度算法来完成相似商品的推荐 商品 Tag 的相关度 利用 Tag 能够用于对商品特征值进行标识的特点,通过 TF/IDF 相似度算法来完成相似商品的推荐
60. 参考资料 Wiki : http://en.wikipedia.org/wiki/Collaborative_filtering http://en.wikipedia.org/wiki/Web_analytics http://en.wikipedia.org/wiki/Recommendation_system 图书 Programming Collective Intelligence: Building Smart Web 2.0 Applications Web Analytics: An Hour a Day Data Mining : Concepts and Techniques Mining the Web:Transforming Customer Data into Cutomer Value Data Mining Techniques: For Marketing, Sales, and Customer Relationship Management
61. 参考资料 开源项目 Open Source Collaborative Filtering Written in Java Carrot2 Clustering Engine Weka 3: Data Mining Software in Java Taste
62. 参考资料 Blog http://glinden.blogspot.com/ http://www.kaushik.net/avinash http://guwendong.cn/ http://www.weigend.com/ http://www.chinawebanalytics.cn/ 数学之美系列 Mining Social Data for Fun and Insight