首页 > 其他 > 详细

Collaborative Filtering

时间:2015-10-25 00:44:55      阅读:301      评论:0      收藏:0      [点我收藏+]

 

 

for i=1:6040
Ai=ratings(ratings(:,1)==i,:);
for j=1:5
Labnum(i,j)=length(Ai(Ai(:,3)==j));
end
num(i)=length(Ai(:,1));
end

num=[[1:6040]‘,num‘];
numsort=sortrows(num,-2);

  

 

Xratings1101_1500=[];
for i=1:1501
Xratings1101_1500=[Xratings1101_1500;ratingsNew1101_518(ratingsNew1101_518(:,1)==numsort1101(i,1),:)];
end

  

 

items1101_518=ratings(ratings(:,1)==1101,2);
ratings1101_518=[];
for i=1:518
items=items1101_518(i);
ratings1101_518=[ratings1101_518;ratings(ratings(:,1)==items,:)];
end
users1101_518 = unique(ratings1101_518(:,1)‘); 

  

items1101_518=ratings(ratings(:,1)==1101,2);
ratings1101_518=[];
for i=1:518
items=items1101_518(i);
ratings1101_518=[ratings1101_518;ratings(ratings(:,2)==items,:)];
end
items1101_518=sortrows(items1101_518,1);

ratingsNew1101_518=ratings1101_518;
for i=1:518
ratingsNew1101_518(ratingsNew1101_518(:,2)==items1101_518(i),2)=i;
end
ratingsNew1101_518=sortrows(ratingsNew1101_518,2);

  

 

Collaborative Filtering

原文:http://www.cnblogs.com/huadongw/p/4907968.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!