APP下载

基于Spark的K近邻ALS的推荐算法

2018-07-28刘佳耀王佳斌

电脑知识与技术 2018年11期

刘佳耀 王佳斌

摘要:传统的协同过滤推荐算法在面对海量数据时表现出处理速度慢和效率低下的瓶颈,与Hadoop平台相比,Spark计算框架具有迭代计算优势,提出了基于spark的K近邻ALS推荐算法。由于一般的矩阵分解算法只考虑隐含信息忽略了相似度的信息,所以将相似度信息加权到评分预测的公式中,并采用交替最小二乘法进行模型训练得出结果。在MovieLens数据集上验证,该改进算法能够提高推荐的准确性,提高对大数据集的处理效率。

关键词:协同过滤;Hadoop;Spark;ALS

中图分类号:TP391.1 文献标识码:A 文章编号:1009-3044(2018)11-0006-02

A Recommendation Algorithm Based on Spark's K neighbor ALS

LIU Jia-yao, WANG Jia-bin

(Institute of Technology Huaqiao University, Quanzhou 362021, China)

Abstract: Traditional collaborative filtering recommendation algorithm in the face of huge amounts of data show the processing speed is slow and inefficient bottleneck, compared with the Hadoop platform, Spark computing framework has the advantages of iterative calculation, and puts forward the K neighbor ALS recommendation algorithm based on the Spark.Due to generally only considered implicit information of the matrix decomposition algorithm ignores the similarity of information, so will be weighted similarity information to score prediction formula, and alternating least squares method is adopted to model the training results.n the MovieLens data set, the improved algorithm can improve the accuracy of recommendation and improve the processing efficiency of large data sets.

Key words: Collaborative filtering; Hadoop; Spark; ALS

1 引言

随着互联网的迅速发展,各种信息也呈爆炸性增长,接踵而来的是出現了“信息过载”的问题。为了解决这个问题,推荐系统由此产生,推荐系统[1]可以通过用户对各种商品的评分或用户以前的浏览记录,来为用户推荐他们所需的信息。协同过滤[2]算法是推荐系统中运用最常用的算法,但是在大数据背景下随着用户和项目数量的不断增长,用户-项目矩阵的稀疏和单机上的瓶颈导致推荐质量和准确性不断下降。

针对以上问题,许多研究人员提出了有效的改进方法。文献[3]提出了基于矩阵分解的协同过滤算法,该算法通过降低数据稀疏性,提高了推荐准确性。文献[4]提出了一种基于矩阵分解与用户近邻模型的混合推荐模型,最大程度上利用用户信息和降维的思想来提升推荐效率,但是没有实现并行化,推荐效率低。文献[5]提出了基于Spark的矩阵分解与最近邻结合算法,该算法通过运用Spark平台的优势,提高了算法的可扩展性和减少了推荐时间。……

登录APP查看全文