数据学习
AI博客
原创AI博客
大模型技术博客
期刊会议
学术世界
期刊出版社
领域期刊
SCI/SCIE/SSCI/EI简介
期刊列表
会议列表
所有期刊分区
学术期刊信息检索
JCR期刊分区查询
CiteScore期刊分区查询
中科院期刊分区查询
管理 - UTD24期刊列表
管理 - AJG(ABS)期刊星级查询
管理 - FMS推荐期刊列表
计算机 - CCF推荐期刊会议列表
南大核心(CSSCI)
合工大小核心
合工大大核心
AI资源仓库
AI领域与任务
AI研究机构
AI学术期刊
AI论文快讯
AI数据集
AI开源工具
数据推荐
AI大模型
国产AI大模型生态全览
AI模型概览图
AI模型月报
AI基础大模型
AI大模型排行榜
大模型综合能力排行榜
大模型编程能力排行榜
OpenLLMLeaderboard中国站
AI大模型大全
大模型部署教程
在线聊天大模型列表
2023年度AI产品总结
Collaborative Filtering for Implicit Feedback Datasets
Vanessa He
Eighth IEEE International Conference on Data Mining. IEEE Computer Society
2008-12
3133
2017/02/09 18:39:22
**一、文章特色** 1、将原观测值r_ui转变成偏好估计p_ui和信度水平c_ui,较好表现源数据的同时,也提高了预测精度; 2、算法复杂度控制在线性运算水平,降低算法复杂度。 **二、WRMF(Weighted matrix factorization)核心思想** 1、引入信度水平的目标函数: ![](http://www.datalearner.com/resources/blog_images/c505423d-fe13-4479-b6c9-4b506b154521.png) 其中: (1)![](http://www.datalearner.com/resources/blog_images/7ee69cd0-2db3-49bc-8849-71bfa4590d23.png):在显示反馈数据集中表示用户u对产品i的偏好评分;在隐式反馈数据集中表示用户行为的观测,如,用户u购买产品i的次数、用户u观看节目i上频率或者用户u花费在网页i上的时间等等。 (2)![](http://www.datalearner.com/resources/blog_images/e815e532-a8b7-4f9f-967a-d2bd063efd07.png):二元变量,如果用户u消费了产品i![](http://www.datalearner.com/resources/blog_images/9a6ee59b-ef6d-48c5-90ef-09462799c076.png),则表明u喜欢i![](http://www.datalearner.com/resources/blog_images/750f2dad-701a-408a-ab75-e83bf46f957e.png)。总结如下: ![](http://www.datalearner.com/resources/blog_images/8970a1ed-8819-4779-9c1b-309b801069e9.png) (3)![](http://www.datalearner.com/resources/blog_images/8d288e9b-2527-45a6-a9e7-77435fd17d22.png):信度水平。 ![](http://www.datalearner.com/resources/blog_images/f8ad3b67-56e7-4290-93eb-9eab92bf77f1.png) 引入信度水平的原因:比如用户购买了产品送给他人,自己也许并不喜欢,又比如用户观看某一电视很长时间,也许只是睡着了,而并不一定就喜欢那个节目,另外,用户没有购买某产品,也许只是因为不知道该产品,并不一定不喜欢。因此,用不同的信度水平表示用户偏好某产品的可能,随着 的增加,用户喜欢该产品的信度越高。 (4)偏好估计:![](http://www.datalearner.com/resources/blog_images/48e1454f-f518-4efc-9e83-4ad6faa83516.png)。![](http://www.datalearner.com/resources/blog_images/b4bcd3e5-83e3-424a-ab4c-9eced51bbc37.png)表示用户-因素矩阵,![](http://www.datalearner.com/resources/blog_images/511cf03c-abcd-40dc-976e-76b8090b5c06.png)表示产品-因素矩阵,本质上来看,这两个矩阵是将用户和产品映射到隐向量空间中,基本思想与矩阵分解中处理方法一致。 (5)![](http://www.datalearner.com/resources/blog_images/93f01efd-2768-4eb1-a73e-8122209ddc6b.png)是为了防止训练数据的过拟合化而引入的正则项。 是依赖于数据的,需要通过交叉验证方式确定。 (6)针对各参数之间的关系,举个例子: ![](http://www.datalearner.com/resources/blog_images/ece4e3ef-2a62-448d-918f-dcb43e3c6426.png) 2、![](http://www.datalearner.com/resources/blog_images/d20c5a35-eeae-43ef-a2b7-909f96162ac1.png)和![](http://www.datalearner.com/resources/blog_images/bb045c43-7ba2-457e-bb8d-d613fa77ee54.png)的更新公式转化,降低计算时间复杂度 (1)因为论文中未给出推导过程,故为了方便下面公式的理解,此处先给出两个更新公式推导过程: 首先,对目标函数C中![](http://www.datalearner.com/resources/blog_images/64aa985c-04de-48ce-956a-5979da0299c4.png)求偏导: ![](http://www.datalearner.com/resources/blog_images/ebc55e09-34c4-4390-b632-aeb90d3840f4.png) 其中Y是item矩阵,n*f维,每一行是一个item_vec,C^u是n*n维的对角矩阵, 对角线上的每一个元素是c_ui,P(u)是n*1的列向量,它的第i个元素为p_ui。 令偏导值为0,则: ![](http://www.datalearner.com/resources/blog_images/4963fc1f-72ff-4eff-8292-235ebfdfe4d3.png) 同理可得目标函数C中![](http://www.datalearner.com/resources/blog_images/c068d334-1c3f-4ccd-94b7-7df7749e766a.png)的更新公式推导过程: ![](http://www.datalearner.com/resources/blog_images/3c5c2941-2871-4075-ac4d-96cb50d989e5.png) 其中X是user矩阵,m*f维度,每一行是一个user_vec,C^i是m*m的对角矩阵,对角线上的每一个元素是c_ui,P(i)是m*1的列向量,它的第u个元素是p_ui 。 令偏导值为0,则: ![](http://www.datalearner.com/resources/blog_images/9b74adb7-8a3c-41ff-b41d-cd5f37cf4a1b.png) (2)总之,![](http://www.datalearner.com/resources/blog_images/d3d28665-2a76-464d-84d4-4de9698268d3.png)和![](http://www.datalearner.com/resources/blog_images/9b8f6806-f4f1-493d-adfc-ff32d6accacf.png)的更新公式如下: ![](http://www.datalearner.com/resources/blog_images/81523d98-be12-4d18-9012-242112a1fa6c.png) 论文的一大贡献是运行时间与输入数据成线性关系。 以![](http://www.datalearner.com/resources/blog_images/1f9f15ea-bc28-4ed1-a363-065ab62c27b7.png)更新公式的转化为例,过程如下: ![](http://www.datalearner.com/resources/blog_images/91246dd7-1335-428d-8aa2-7b453e452e98.png)。其中![](http://www.datalearner.com/resources/blog_images/f24a5328-24b2-4f24-a544-5a7872e58bd9.png)时间复杂度![](http://www.datalearner.com/resources/blog_images/606a1d02-97d0-4a80-acd6-2718899d07f9.png) ,因其不依赖于用户,故可以提前计算好。而![](http://www.datalearner.com/resources/blog_images/1b142a0a-754f-4f11-ac5d-2dcc113210c2.png)中,![](http://www.datalearner.com/resources/blog_images/aca5421f-f3ca-4f5b-81a1-1f7b9ac398c1.png)仅有n_u个非零元素,n_u表示![](http://www.datalearner.com/resources/blog_images/01947ff7-d857-4b7f-9bca-29ce1b16f127.png)的产品数量。 同样地,![](http://www.datalearner.com/resources/blog_images/4fa8bc2c-8f91-4f7e-8eff-7b07d40154b6.png)也有n_u个非零元素。 这样的话,![](http://www.datalearner.com/resources/blog_images/6ff8872d-7096-4485-9850-c33ed62b575e.png)时间复杂度是![](http://www.datalearner.com/resources/blog_images/42e0c033-7341-4f2a-ab96-de03fb506002.png),其中![](http://www.datalearner.com/resources/blog_images/b2c9d821-8bad-4e61-99e1-56f167ac056a.png)时间复杂度是![](http://www.datalearner.com/resources/blog_images/fbc67201-ba7b-4751-a934-5dbe6d516dc6.png)。对于m个用户来说,总复杂度为![](http://www.datalearner.com/resources/blog_images/b609659d-9b27-4448-9c19-b2f406471402.png),其中,![](http://www.datalearner.com/resources/blog_images/f565d1a6-792d-4da8-af52-573c34e69fed.png),表示所有矩阵中![](http://www.datalearner.com/resources/blog_images/a3e9779e-8ab9-403c-80fe-6638e76a3b1a.png)的总数量。 ![](http://www.datalearner.com/resources/blog_images/53c532b1-5e73-45c1-919e-ea1614e4a3a4.png)更新公式的转化过程同理,此处不做推理。 **三、MyMediaLiteJava-master工具中WRMF核心优化程序** protected void optimize(IBooleanMatrix data, Matrix
W, Matrix
H) { Matrix
HH = new Matrix
(numFactors, numFactors); Matrix
HC_minus_IH = new Matrix
(numFactors, numFactors); double[] HCp = new double[numFactors]; DenseDoubleMatrix2D m = new DenseDoubleMatrix2D(numFactors, numFactors); // Source code comments are in terms of computing the user factors // Works the same with users and items exchanged // (1) Create HH in O(f^2|Items|) // HH is symmetric for (int f_1 = 0; f_1 < numFactors; f_1++) for (int f_2 = 0; f_2 < numFactors; f_2++) { double d = 0; for (int i = 0; i < H.dim1; i++) d += H.get(i, f_1) * H.get(i, f_2); HH.set(f_1, f_2, d); } // (2) Optimize all U // HC_minus_IH is symmetric for (int u = 0; u < W.dim1; u++) { IntList row = data.getEntriesByRow(u); // Create HC_minus_IH in O(f^2|S_u|) for (int f_1 = 0; f_1 < numFactors; f_1++) for (int f_2 = 0; f_2 < numFactors; f_2++) { double d = 0; for (int i : row) //d += H.get(i, f_1) * H.get(i, f_2) * (c_pos - 1); d += H.get(i, f_1) * H.get(i, f_2) * cPos; HC_minus_IH.set(f_1, f_2, d); } // Create HCp in O(f|S_u|) for (int f = 0; f < numFactors; f++) { double d = 0; for (int i : row) //d += H.get(i, f) * c_pos; d += H.get(i, f) * (1 + cPos); HCp[f] = d; } // Create m = HH + HC_minus_IH + reg*I // m is symmetric // The inverse m_inv is symmetric for (int f_1 = 0; f_1 < numFactors; f_1++) for (int f_2 = 0; f_2 < numFactors; f_2++) { double d = HH.get(f_1, f_2) + HC_minus_IH.get(f_1, f_2); if (f_1 == f_2) d += regularization; m.set(f_1, f_2, d); } DoubleMatrix2D m_inv = Algebra.DEFAULT.inverse(m);//求逆 // Write back optimal W for (int f = 0; f < numFactors; f++) { double d = 0; for (int f_2 = 0; f_2 < numFactors; f_2++) d += m_inv.get(f, f_2) * HCp[f_2]; W.set(u, f, d); } } }
赏
支付宝扫码打赏
如果文章对您有帮助,欢迎打赏鼓励作者
Back to Top