第4节 training trick 那节TBC
上一篇讲到libFM的作者对比了libFM和SVDFeature,认为SVDFeature也是一种通用的矩阵分解模型,但是各有优缺点:
所以,我们看看为什么作者这么说?
SVDFeature作者是大神陈天奇,也是XGBoost和cxxnet的作者。本文主要参考资料为论文https://arxiv.org/pdf/1109.2271.pdf和SVDFeature的手册
由Apex Data & Knowledge Management Lab在KDD CUP11竞赛中开发出来的工具包。它的目的是有效地解决基于特征的矩阵分解.
通用的模型定义为
其中
可以转换成基础的矩阵分解模型,如果我们定义
模型训练
使用对每个用户将数据group倒一起,每一个用户共享同样的隐式和显示反馈信息来进行加速,具体的原理TODO
r k n m (global features) (user features) (item features)
r表示预测值
k表示全局feature的维度
n表示用户feature的维度
m表示物品feature的维度
5 0 1 1 0:1 10:1表示user0对item10打分5
如果原始数据ua.base的格式为每行uid iid rate, generate feature from ua.base.shufflesvdpp_randorder ua.base ua.svdpporder
line_reorder ua.base ua.svdpporder ua.base.shuffle
user feedback file
This file contains one line for each user, the order is same as the user order of the user grouped feature file. The first column gives the number of lines in grouped feature file of corresponding user. Then it specifies the implicit feedback information using the sparse feature format.
assume user 3 have rated item 2,4,6,7, and he has 3 lines in the grouped training file, then the extra file for implicit feedback is formatted as follows:
3 4 2:0.5 4:0.5 6:0.5 7:0.5
svd_feature config.conf num_round=10
svd_feature config.conf num_round=10 continue =1
svd_feature_infer config.conf
svd_feature_infer config.conf pred=6 name_pred=pred.txt
http://dataera.org/2013/04/%E7%AE%80%E5%8D%95%E8%AF%B4%E8%AF%B4%E6%8E%A8%E8%8D%90%E6%A8%A1%E5%9E%8B/
我的理解是:非latent部分:feature本身对于rating分数是会有一定作用的,比如用户对于所有物品的打分的平均分,物品收到的平均打分,这就是上述公式的前两项;latent部分,首先假设有N维的latent factor,被用户与产品共享,(所以\mathbf{p}, \mathbf{q}的维度是一致的),所有的feature都可以在latent factor上进行分解,比如,不同的用户本身在latent factor上的“响应值”分布是不同的,不同的物品也是这样,而对于其他feature,比如标签或类别:“动作片”,也将其在latent factor空间进行分解(学出来的latent factor空间的“响应”应该在“动作片”相关的一个或几个factor上特别大)。如此以来,一对user-item pair对应的feature在latent空间分解后相乘(上述公式的第三项)就代表了latent factor各处的rating的预期。对于social relation,可以直接认为是一种feature,用上述公式就能融入。但是还有些更加sophisticated的方法(请自行用recommendation+social relation谷歌),但是,本质上也没有太大的差别。
《Feature-Based Matrix Factorization》
原文:https://www.cnblogs.com/cx2016/p/13575669.html