bug修改

This commit is contained in:
tarzan
2023-03-27 09:14:37 +08:00
parent 2ab736a59e
commit b4bd7e305a
3 changed files with 14 additions and 4 deletions

View File

@@ -12,10 +12,10 @@ public class RecommendSystemApplication {
public static void main(String[] args) {
//SpringApplication.run(RecommendSystemApplication.class, args);
System.out.println("------基于用户协同过滤推荐---------------下列电影");
List<ItemDTO> itemList= Recommend.userCfRecommend(2);
List<ItemDTO> itemList= Recommend.userCfRecommend(1);
itemList.forEach(e-> System.out.println(e.getName()));
System.out.println("------基于物品协同过滤推荐---------------下列电影");
List<ItemDTO> itemList1= Recommend.itemCfRecommend(2);
List<ItemDTO> itemList1= Recommend.itemCfRecommend(1);
itemList1.forEach(e-> System.out.println(e.getName()));
}

View File

@@ -33,8 +33,8 @@ public class CoreMath {
//关系系数
double coefficient = relateDist(v,userItems,type);
//关系距离
double distance=Math.abs(coefficient);
distMap.put(k,distance);
// double distance=Math.abs(coefficient);
distMap.put(k,coefficient);
}
});
return distMap;

View File

@@ -0,0 +1,10 @@
1 1 1 847117005
1 2 10 847642142
1 3 1 847641896
2 1 2 847642008
2 3 2 847641956
3 1 3 847641956
3 3 3 847642073
4 1 4 847642105
4 2 1 847116751
4 3 5 847116787