基于用户的推荐算法
| 基于用戶(項目)協同過濾
輸入:訓練集用戶列表U,訓練集電影列表I,評分矩陣R,鄰居數目K,測試集用戶列表UT 輸出:給每位用戶(共計N位用戶)產生一個推薦列表,其中包含M部電影
|
| UCF: Start: //構建用戶相似度矩陣 For user For query Calculate sim(ux,uy) End for End for
//使用計算好的用戶相似度 構建用戶相似度矩陣SM //推薦流程 For user and //找到用戶向量 Forming user vector with each row of R expressing the watching list of user , containing movies //選擇K位鄰居 Select K users as the neighbors of with whose is bigger than other inS |
總結