Machine Learning

xiaoxiao2021-02-28  37

本文将从以下两方面简单介绍本次任务的完成情况: 1. 实现算法简单介绍 2. 程序运行说明

一、 实现算法简单介绍

本次推荐系统采用基于用户的协同滤波推荐,来自参考文献[1]。 user a对item j的评分预测可以通过下列公式得到:

其中,va为user a所有评分的平均值,vij为user i对item j的评分,vi为user i所有评分的平均值, w(a,i)为user a和user i之间的相关系数:

k为归一化因子,前k大相关系数之和: k为所取的邻居数,根据参考文献[2]中figure6发现一味地增加邻居数,预测效果会下降,故本次任务中取10。

注: 关于cold start的处理:对于在对user a对应的item进行评分时,若新出现的item,则将其置为user a评分的平均值。

参考文献: [1] J. Breese, D.. Heckerman, and C. Kadie, Empirical analysis of predictive algorithms for collaborative filtering, Proc. Conf. Uncertainty in Artificial Intelligence, (UAI98) 1998 [2] J.L. Herlocker, J.A. Konstan, J.R.A. Borchers, and J. Riedl, An algorithmic framework for performing collaborative filtering, Proc. International on ACM SIGIR Research and Development in Information Retrieval, (SIGIR98) 1998

二、 程序运行说明

本次任务代码运用python编写。 Python版本:Python 2.7.13

train_all_txt.txt:为训练数据; allUserItem.txt:是由getTestFile.py得到的所有user对应所有item的评分文件,每个评分初始化为0; userCF.py:主程序,用于实现基于用户的协同滤波算法,实现评分预测,运行本程序后会得到最终预测文件prediction_baseOnUserCF.txt,运行一次约6mins; similarity_baseOnUser.txt:是由主程序输出的用户之间相关系数矩阵文件; prediction_baseOnUserCF.txt:是由主程序输出的最终预测评分文件。

转载请注明原文地址: https://www.6miu.com/read-600375.html

最新回复(0)