1).读入数据,将数据用user_brands存起来,同时建立userid_id,再建立id_brands 2).遍历id_brands得到物品-用户倒排表brand_ids,根据倒排表得到用户的相似矩阵sim_mat 3).为每个用户推荐产品:   3.1).求用户u买过的brand和所有brand的差集得到用户u没有买过的物品集合brand_unused;   3.2).用户u对每一个没用过的物品i的兴趣p(u,i):     3.2.1).找到与用户u最近的k个用户     对于每一个没用过的物品i:     3.2.2).找出这k个用户中对物品i有过行为的用户v[]√     3.2.3).将用户u和v[j]的兴趣相似度累加   3.3).取前m个最感兴趣的brand推荐给用户; 代码:UCF.cc(用户协同过滤核心代码):#include #include #include #include #include #include #include #include #include #include -IMDN开发者社群-imdn.cn"> 1).读入数据,将数据用user_brands存起来,同时建立userid_id,再建立id_brands 2).遍历id_brands得到物品-用户倒排表brand_ids,根据倒排表得到用户的相似矩阵sim_mat 3).为每个用户推荐产品:   3.1).求用户u买过的brand和所有brand的差集得到用户u没有买过的物品集合brand_unused;   3.2).用户u对每一个没用过的物品i的兴趣p(u,i):     3.2.1).找到与用户u最近的k个用户     对于每一个没用过的物品i:     3.2.2).找出这k个用户中对物品i有过行为的用户v[]√     3.2.3).将用户u和v[j]的兴趣相似度累加   3.3).取前m个最感兴趣的brand推荐给用户; 代码:UCF.cc(用户协同过滤核心代码):#include #include #include #include #include #include #include #include #include #include  - IMDN开发者社群-imdn.cn">
登录
首页 » 算法 » C++实现基于用户的协同过滤

C++实现基于用户的协同过滤

于 2023-03-01 发布 文件大小:115.91 kB
0 377
下载积分: 2 下载次数: 1

代码说明:

算法过程:1).读入数据,将数据用user_brands存起来,同时建立userid_id,再建立id_brands  2).遍历id_brands得到物品-用户倒排表brand_ids,根据倒排表得到用户的相似矩阵sim_mat  3).为每个用户推荐产品:      3.1).求用户u买过的brand和所有brand的差集得到用户u没有买过的物品集合brand_unused;      3.2).用户u对每一个没用过的物品i的兴趣p(u,i):          3.2.1).找到与用户u最近的k个用户          对于每一个没用过的物品i:          3.2.2).找出这k个用户中对物品i有过行为的用户v[]√          3.2.3).将用户u和v[j]的兴趣相似度累加      3.3).取前m个最感兴趣的brand推荐给用户;  代码:UCF.cc(用户协同过滤核心代码):#include  #include  #include  #include  #include  #include  #include  #include  #include  #include  

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • logistic 混沌扰动
    数学中的混沌扰动仿真,其中的参数可以任意修改,参数的不同,混沌的效果也不同,这种混沌扰动可以应用到算法改进和扩大多样性中去,改程序经过测试,可以直接运行,上面的图片就是仿真结果,这个程序是我之前看的一篇文献当中的,拿下来学习一下,曾改进过算法,有很好的效果,希望能帮到大家。
    2022-01-31 19:09:49下载
    积分:1
  • K-means的实现
    c++ 语言实现算法,用的时候把数据集里面的数据放到C盘下,直接运行就行,数据集提供了两种,方便计算
    2022-08-15 07:31:27下载
    积分:1
  • 一元二次方程求解
    一元二次方程求解-One dollar for solving quadratic equations
    2022-01-25 17:58:17下载
    积分:1
  • 拓扑优化源代码
    这是一个拓扑优化的源程序~程序简单实用~但是该程序只是简单程序,各位如果想做复杂结构或别的优化法则的的话,可以从该程序中进行拓展。
    2022-05-12 11:50:11下载
    积分:1
  • not extract passwords AHP process
    没有解压密码的AHP程序-not extract passwords AHP process
    2022-11-17 01:15:03下载
    积分:1
  • Fifty Years of Shannon Theory
    应用背景 Fifty Years of Shannon Theory: A brief chronicle is given of the historical development of the central problems in the theory of fundamental limits of data compression and reliable communication. 关键技术Shannon’s A mathematical theory of communication”published in July and October of 1948 is the Magna Carta of the information age. Shannon’s discoveryof the fundamental laws of data compression and transmission marks the birth of Information Theory. A unifying theory with profound intersections with Probability, Statistics, Computer Science, and other fields, Information Theory continues to set the stage for the development of communications, data storage and processing, and other information technologies.
    2022-02-13 17:00:08下载
    积分:1
  • 的一个比较重要的高斯约当消去方
    计算方法的一个比较重要的高斯约当消去方法-calculation of a more important about when Gaussian Elimination Methods
    2022-05-13 18:38:09下载
    积分:1
  • 求解非线性方程组的一个高效,用FORTRAN实现.
    求解非线性方程组的一个高效算法,用FORTRAN实现.-Solving nonlinear equations of an efficient algorithm, using FORTRAN realize.
    2022-04-24 00:12:44下载
    积分:1
  • 模糊控制器
    进行模糊控制逻辑运算,输入为误差和误差变化率,采用三角形隶属函数进行模糊化,采用最大最小法进行模糊推理,采用重心法进行去模糊化。
    2022-02-13 13:03:46下载
    积分:1
  • C语言实现AES
    Project作业,C语言实现AES算法,作业要求更改S-BOX,并输出每一个round的内容. 部分代码借鉴了网友的东西。 编写的很简单,给大家看一看,适合新手。希望大家能提出宝贵意见!
    2023-02-10 03:45:03下载
    积分:1
  • 696516资源总数
  • 106918会员总数
  • 4今日下载