基於矩陣分解的協同過濾算法


輸入

  稀疏的物品用戶評分矩陣。

輸出

  輸出1:基於矩陣分解得到的兩個子矩陣。

  輸出2:根據輸出2得到的已被填充的物品用戶評分矩陣

前言

  當用戶、物品較多的時候,基於用戶和物品的協同過濾算法存在稀疏性的問題,將矩陣分解應用於協同過濾算法可以提取物品、用戶的隱式特征,發現一些不是顯而易見的特征,在一定程度上解決了稀疏問題的同時,也將大的行為矩陣分解為小的用戶隱式特征矩陣和小的物品隱式特征矩陣,減小了計算量,提高了准確率和計算速度。 

Func-SVD矩陣分解原理

  有了近鄰模型的用戶物品關系矩陣后,為什么還需要用到矩陣分解呢?這是因為近鄰模型存在以下的問題:

  1. 物品之間存在相關性,但是信息量並不隨着向量維度增加而線性增加
  2. 近鄰模型的用戶物品關系矩陣是稀疏矩陣,計算結果不穩定,增減一個向量維度,可能近鄰模型結果差異較大。

  矩陣分解可以解決上面的問題。矩陣分解就是把原來的用戶物品關系大矩陣近似分解為兩個小矩陣的乘積,假設有一個用戶評分矩陣,其中m=10 0000n = 1 000,即一共有10萬個用戶,1萬個物品,那么用戶物品矩陣中的元素個數為10億。我們選擇一個較小的數kkmn小很多,假如取值為10,通過一系列的計算得到兩個矩陣,這兩個子矩陣可以通過如下公式近似復原大矩陣:

 

 

  通過這一系列操作可以使用涉及計算的元素數從10億下降到110萬,通過計算量上可以看出矩陣分解的優勢。這里再從實際物理意義上解釋以下,矩陣分別把用戶和物品都映射到一個k維空間上。對於每一個用戶而言,會得到一個向量,維度為k,這個向量稱為隱因子向量,向量中的元素有正有負,代表這個用戶在若干因素上的偏好。對於一個物品而言,會得到一個向量,維度為k,這個向量稱為隱因子向量,向量中的元素有正有負,代表這個物品背后隱藏的一些用戶關注的因素。

  矩陣分解之后,對於一個用戶u的隱因子向量為,物品i的隱因子向量為,那么將物品i推薦給用戶u的推薦分數,可以直接通過下面的點積計算即可:

  

  這個公式很簡單,關鍵是如何得到每一個用戶、每一個物品的k維向量?我們可以按照機器學習的思路,首先定義損失函數,然后使用優化算法進行優化,減小預測結果與實際用戶評分之間的誤差。

 

  任意用戶u與任意物品iFunc-svd算法損失函數定義如下:

  式中為用戶u對物品i的真實評分。加號前的部分控制着模型的偏差,防止“欠擬合”。加號后的部分采用正則化項控制着模型的方差,讓模型執行推薦任務時穩定發揮,防止“過擬合”的發生。 

  我們采用梯度下降優化算法,慢慢朝着梯度的反方向不斷迭代得到使損失函數最小的參數值,得到的參數值就是我們要求的每一個用戶、物品的k維隱因子向量。 

  下面具體討論下如何應用梯度下降算法,首先我們要搞清楚:

  1. 每一個樣本是什么
  2. 未知參數是什么

  我們要擬合的對象是用戶物品關系矩陣,可以把矩陣中的每一個元素看成一個樣本,每個樣本就是用戶對物品的評分,我們的預測過程就是讓用戶的隱因子向量與物品的隱因子向量做點積得到的預測分數逼近樣本,隱因子向量之間的點積可以表示為:

  

其中分別代表中的每一個元素中的元素值,是分解后的子矩陣中的元素值,也就是我們一直在尋找的未知參數。

  我們分別對求偏導數:

為實際值與預測值之間的誤差;

為實際值與預測值之間的誤差。

  按照隨機梯度下降算法,我們分別更新

  通過前面一些列操作后,可以得到分解后的兩個子矩陣PQ,兩個子矩陣相乘就可得物品用戶評分矩陣,有個這個物品用戶評分矩陣就可以給用戶推薦評分較高的物品了。

Func-svd矩陣分解算法流程

  流程如下:

  1. 隨機生成一個稀疏的物品用戶評分矩陣
  2. 初始化分解后的子矩陣
  3. 計算預測分數與實際分數之差
  4. 按照上述參數更新公式同步更新子矩陣中的元素值
  5. 迭代重復步驟34,直至迭代次數執行完畢。

python代碼實現

 1 import numpy as np
 2 import scipy as spy
 3 import scipy.sparse
 4 import heapq
 5 
 6 # 構造一個稀疏的50 * 100物品用戶評分矩陣
 7 # 隨機生成120個坐標,行坐標取值范圍為[0,50),列坐標取值范圍為[0,100),生成的非零元素占總數的24%,非零元素取值范圍為1,2,3,4,5
 8 # 行對應物品,列對應用戶
 9 row_num = 50
10 col_num = 100
11 nonzero_percent = 0.24
12 nonzero_num = int(row_num * col_num * nonzero_percent)
13 
14 row = np.random.randint(0,row_num,size=nonzero_num)
15 col = np.random.randint(0,col_num,size=nonzero_num)
16 data = np.random.randint(1,6,size=nonzero_num)
17 sparse_matrix = spy.sparse.coo_matrix((data, (row,col)), shape=(row_num,col_num))
18 sparse_matrix = sparse_matrix.toarray()
19 
20 # 隱因子特征個數
21 k = 4
22 # 子矩陣
23 item_feature_matrix = np.random.rand(row_num, k)
24 user_feature_matrix = np.random.rand(col_num, k)
25 # 迭代次數
26 step = 100
27 # 學習率
28 alpha = 0.00005
29 # 正則化系數
30 lamda = 0.0001
31 # 迭代學習
32 for s in range(0, step):
33     err_square_sum = 0.0
34     for r in range(0, row_num):
35         for c in range(0, col_num):
36             # 計算預測的分數,(r,c)
37             predict = np.dot(item_feature_matrix[r], user_feature_matrix[c])
38             # 計算實際值與預測值之差
39             err = float(sparse_matrix[r][c]) - predict
40             err_square_sum = err_square_sum + err*err
41             # 更新物品的隱因子向量, 可以把k個參數的更新合並為向量形式處理
42             item_feature_matrix_tmp = item_feature_matrix[r] + 2 * alpha * (user_feature_matrix[c] * err - lamda * item_feature_matrix[r])
43             # 更新用戶的隱因子向量, 可以把k個參數的更新合並為向量形式處理
44             user_feature_matrix_tmp = user_feature_matrix[c] +2*alpha*(item_feature_matrix[r] * err - lamda * user_feature_matrix[c])
45             item_feature_matrix[r] = item_feature_matrix_tmp
46             user_feature_matrix[c] = user_feature_matrix_tmp
47     #print('step[{}] err_square_sum:{}, err_square_sum_sqrt:{}'.format(s, err_square_sum, np.sqrt(err_square_sum)))
48 print('item_feature_matrix:\n{}'.format(item_feature_matrix))
49 print('user_feature_matrix:\n{}'.format(user_feature_matrix))
50 
51 # 兩個分解后的子矩陣相乘,得到擬合的物品用戶評分矩陣
52 result_matrix = np.dot(item_feature_matrix, user_feature_matrix.T)
53 
54 # 得到擬合的物品用戶評分矩陣后就可以給用戶推薦評分最高的k個物品了
55 topK = 5
56 for col in range(0, col_num):
57     # 每個用戶已經有過正面行為的物品索引
58     col_nonzero = list(np.nonzero(sparse_matrix[:,col])[0])
59 
60     # 擬合的物品用戶評分矩陣中的用戶列,按照分數從大到小給對應的物品索引排序
61     result_col = list(result_matrix[:, col])
62     result_col_list = list(map(result_col.index, heapq.nlargest(len(result_col), result_col)))
63     result_sorted = list(set(result_col_list) - set(col_nonzero))
64 
65     # 由於set會排序,所以讓result_sorted按照result_col_list中元素出現的順序排序一次
66     result_sorted.sort(key = result_col_list.index)
67     print('user[{}] recomm top{} item index{}.'.format(col, topK, result_sorted[0:topK]))

代碼運行結果

  物品、用戶對應的子矩陣分別為:

item_feature_matrix:
[[ 0.03815294  0.27363359  0.77153174  0.54227361]
 [ 0.21269573  0.68036887  0.2426544   0.42999241]
 [ 0.31245104  0.75214563  0.40265404  0.2350196 ]
 [ 0.03466879  0.63767061  0.85363927  0.15510582]
 [ 0.48829391  0.93028627 -0.02388764  0.05320366]
 [ 0.00516792  0.64333964  0.72513124  0.61296299]
 [ 0.24170614 -0.13107477  0.59153735  0.62460286]
 [ 0.47115183  0.11047297  0.45108335  0.46131663]
 [ 0.20375485  0.73869132  0.03624613  0.60637489]
 [ 0.46122603  0.64964078 -0.08344563  0.67410082]
 [ 0.01296464  0.47506547  0.46080148  0.43718642]
 [ 0.462169    0.0268829   0.16953691  0.73759859]
 [ 0.71898992  0.61008224  0.60496649  0.42481064]
 [ 0.32563393  0.08168112  0.71311962  0.24928481]
 [ 0.01956568  0.73094537  0.20346526  0.36358169]
 [ 0.75956275  0.22251061  0.43324305  0.23199092]
 [ 0.54071006  0.54451661  0.08181357  0.10345228]
 [ 0.68317703  0.13680793  0.88146372  0.08597072]
 [-0.03022014  0.84148064  0.04340872  0.86745991]
 [ 0.53380272  0.34188102  0.51066672  0.41949286]
 [ 0.28193541  0.13412116  0.27593822  0.12426465]
 [ 0.37660074  0.17320095  0.22557869  0.20447491]
 [ 0.55412482  0.15832019  0.2964651   0.22434787]
 [ 0.21295654  0.64320058  0.72915644 -0.05395697]
 [ 0.83787569  0.07282222  0.33267275  0.54186705]
 [-0.02624395  0.8608491   0.69352583  0.30311564]
 [ 0.26762334  0.24108357  0.92964933  0.19015744]
 [ 0.71989345  0.26675654  0.17264111  0.43218162]
 [ 0.74211209  0.23895462  0.10939728  0.44135878]
 [ 0.39646097  0.15764006  0.48071145  0.42536731]
 [ 0.47313741  0.6923975   0.02877095  0.47659928]
 [ 0.3964035   0.9081282   0.05172086  0.37801864]
 [ 0.2466458   0.20124427  0.36397067  0.47527814]
 [ 0.06217036  0.81991677  0.37383756  0.17195484]
 [ 0.34001096  0.06386024  0.64754074  0.33551256]
 [ 0.17864421  0.37399402  0.59208105  0.46959896]
 [ 0.14622162  0.74723429  0.16770708  0.41126472]
 [ 0.26762325  0.61986371  0.51516632  0.27664387]
 [ 0.88204065  0.1301938   0.13773601  0.38367914]
 [ 0.93563982  0.17763096  0.90713193  0.14697771]
 [ 0.15076967  0.21750972  0.84224829  0.27047667]
 [ 0.65787809  0.2914638   0.46572356  0.30757336]
 [ 0.71913927  0.38850381  0.15213576 -0.07125686]
 [ 0.36025604  0.21870606  0.90031444  0.00993696]
 [ 0.59402938  0.5708491   0.65787947  0.1937847 ]
 [ 0.69487063  0.20212852  0.08989774  0.63226233]
 [ 0.23587344  0.60192867  0.72874217 -0.01704428]
 [ 0.14957317  0.54256011  0.62184701  0.66951593]
 [ 0.78557413  0.32944578  0.13396761  0.14370084]
 [ 0.0907467   0.45201933  0.84804909  0.00250526]]

user_feature_matrix:
[[ 0.11521203  0.14045107  0.09893995  0.46542164]
 [ 0.81278426  0.06100057  0.66760294  0.45208333]
 [ 0.45227198  0.79438182  0.31951865  0.50106877]
 [ 0.11086751  0.39516757  0.57132531  0.29973682]
 [ 0.36382007  0.69859556  0.77124287  0.25699502]
 [ 0.72048434  0.36360587  0.85453204  0.79225544]
 [ 0.16579383  0.5418168   0.5960547   0.69995107]
 [ 0.8862315   0.41835196  0.20163866  0.21113462]
 [ 0.14690413  0.71180756 -0.02804777  0.84006708]
 [ 0.47037296  0.79730002  0.7267128   0.84177168]
 [ 0.19275169  0.66012905  0.88471975  0.37760039]
 [ 0.65239629  0.7743223   0.43434867  0.10640868]
 [ 0.38770015  0.47424973  0.44899782  0.67001985]
 [ 0.76245003  0.43299962  0.75784507  0.33222405]
 [ 0.1782431   0.370513    0.5876269   0.41947032]
 [ 0.7524921   0.72064244  0.58366462  0.56454841]
 [ 0.53809163  0.09403074  0.49585232  0.46550333]
 [ 0.17726497  0.6283496   0.0741329   0.34174636]
 [ 0.3612117   0.31973043  0.28178275  0.44410623]
 [ 0.85634395  0.51091266  0.39624926  0.37847793]
 [ 0.79642014  0.76113757  0.41079405 -0.00518456]
 [ 0.50743275  0.40433838  0.70386364  0.17195002]
 [ 0.2412731   0.73655272  0.86250831  0.81349939]
 [ 0.7328936   0.02880849  0.84816602  0.35709811]
 [ 0.57369757  0.5842212   0.49556646  0.8725488 ]
 [ 0.24687048  0.19972617  0.14421856  0.60989785]
 [ 0.80179489  0.26021455  0.79437174  0.86692789]
 [ 0.17563947  0.41955746  0.31737709  0.84267472]
 [ 0.04766648  0.60736814  0.20658815  0.11064433]
 [ 0.31420935  0.87476689  0.30739564  0.52996786]
 [ 0.32129587  0.76035271  0.72569946  0.41898513]
 [ 0.13950463  0.97666771  0.18756906  0.31162981]
 [ 0.4522104   0.53116359  0.50864605  0.59175385]
 [ 0.67546585  0.46083944  0.37905385  0.79809776]
 [ 0.3435977   0.66310882  0.31560013  0.40799053]
 [ 0.26792403  0.59208668  0.61720541  0.55751939]
 [ 0.32492177  0.42609086  0.20138479  0.16960351]
 [ 0.79606978  0.55877004  0.67048217  0.58331945]
 [ 0.40184358  0.00869697  0.32286543  0.60983446]
 [ 0.43613464  0.46799383  0.27870131  0.4992056 ]
 [ 0.3816617   0.76788648  0.13587515  0.01958339]
 [ 0.71408577  0.53743082  0.05368163  1.01253652]
 [ 0.34386213  0.90100965  0.53262177  0.02811771]
 [ 0.70260885  0.77541117  0.82230193  0.29138748]
 [ 0.04203174  0.37936115  0.82411838  0.85913914]
 [ 0.1746978   0.44784718  0.76885937  0.3900209 ]
 [ 0.50579837  0.16598252  0.58226507  0.25448044]
 [ 0.81859737  0.22757085  0.77750205  0.1910416 ]
 [ 0.20725001  0.64509784  0.59502809  1.02363971]
 [ 0.16471448  0.48178428  0.28084478  0.29215533]
 [ 0.01222401  0.55149508  0.7725182   0.06630703]
 [ 0.50833839  0.59923644  0.90424154  0.87592624]
 [ 0.67162359  0.19867175  0.32155348  0.32065225]
 [ 0.42442865  0.59241858  0.17491728  0.39415923]
 [ 0.1535186   0.20994201  0.30739078  0.18394098]
 [ 0.67908257  0.24931415  0.19230305  0.45797062]
 [-0.0448856   0.64775836  0.81445933  0.79959512]
 [ 0.84439248  0.49750907  0.71243761  0.51918054]
 [ 0.61084886  0.86587013  0.20966544  0.42533917]
 [ 0.62748228  0.14239228  0.38609916  0.69799837]
 [ 0.08686589  0.69612364  0.40614262  0.32263457]
 [ 0.93369914  0.69872604  0.76729961  0.58844938]
 [ 0.01492096  0.70225254  0.54499709  0.6397506 ]
 [ 0.93998893  0.3638866   0.73254678  0.67495334]
 [ 0.24660158  0.21552205  0.37580357  0.38768617]
 [ 0.88774131  0.1108508   0.48685424  0.63140158]
 [ 0.62415843  0.22168141  0.33810889  0.30885676]
 [ 0.42396588  0.80783038  0.06019684  0.31792649]
 [ 0.61802937  0.22571977  0.52555304  0.73425222]
 [ 0.69751088 -0.04913395  0.73970307  0.78167312]
 [ 0.62413117  0.71929267  1.00899681  0.41542025]
 [ 0.26003222  0.78034116  0.47072729  0.4445519 ]
 [ 0.40464672  0.4349067   0.0841264   0.06221471]
 [ 0.05482579  0.1007112   0.09233979  0.5174141 ]
 [ 0.69532606  0.04273825  0.35819236  0.03961402]
 [ 0.46452231  0.26013452  0.44456707  0.50689449]
 [ 0.20649246  0.87409328  0.3567542   0.73543836]
 [ 0.6977535   0.04901912  0.65464808  0.96516535]
 [ 0.369632    0.39882461  0.96656917  0.93834896]
 [ 0.55694401  0.75140335  0.24022181  0.3124016 ]
 [ 0.44372413  0.41725635  0.33566412  0.51733404]
 [ 0.19138185  0.47516269  0.33990125  0.24807385]
 [ 0.55466254  0.47411354  0.31020752  0.77732279]
 [ 0.46334517  0.25906774  0.58560635  0.05045128]
 [ 0.19686604  0.13714746  0.68441658  0.28208454]
 [ 0.07961152  0.22422996  0.49905313  0.67873814]
 [ 0.71546485  0.46906588  0.63530578  0.79204208]
 [ 0.04546323  0.6166173   0.07079213  0.86272295]
 [ 0.43528354  0.38913819  0.77866379  0.07008442]
 [ 0.64458754  0.44647384  0.59088872  0.52193555]
 [ 0.09451839  0.89901222  0.50693857  0.64699438]
 [ 0.83405603  0.8104802   0.48346463  0.18745681]
 [ 0.29678195  0.75341714  0.21398551  0.55010746]
 [ 0.02867159  0.24392239  0.12933547  0.57638377]
 [ 0.61859093  0.10797207  0.27077118  0.26633497]
 [ 0.43462662  0.36017641  0.89791329  0.4342225 ]
 [ 0.12369494  0.30802789  0.16510708  0.647429  ]
 [ 0.51623846 -0.10661747  0.78989947  0.8900735 ]
 [ 0.86709088  0.14168437  0.79141141  0.81962315]
 [ 0.47296007  0.29645477  0.6059639   0.71236246]]

  對每個用戶推薦的結果:

  1 user[0] recomm top5 item index[18, 47, 9, 5, 12].
  2 user[1] recomm top5 item index[39, 17, 24, 44, 15].
  3 user[2] recomm top5 item index[12, 18, 25, 9, 44].
  4 user[3] recomm top5 item index[5, 25, 39, 44, 0].
  5 user[4] recomm top5 item index[12, 39, 44, 5, 17].
  6 user[5] recomm top5 item index[39, 24, 19, 26, 0].
  7 user[6] recomm top5 item index[5, 47, 12, 0, 3].
  8 user[7] recomm top5 item index[39, 38, 44, 15, 48].
  9 user[8] recomm top5 item index[18, 9, 8, 31, 30].
 10 user[9] recomm top5 item index[5, 47, 25, 44, 31].
 11 user[10] recomm top5 item index[25, 3, 12, 39, 44].
 12 user[11] recomm top5 item index[12, 39, 44, 4, 31].
 13 user[12] recomm top5 item index[12, 5, 18, 39, 44].
 14 user[13] recomm top5 item index[12, 17, 44, 19, 15].
 15 user[14] recomm top5 item index[12, 47, 0, 44, 17].
 16 user[15] recomm top5 item index[39, 44, 47, 5, 31].
 17 user[16] recomm top5 item index[39, 12, 24, 17, 19].
 18 user[17] recomm top5 item index[18, 9, 8, 12, 25].
 19 user[18] recomm top5 item index[39, 47, 5, 44, 24].
 20 user[19] recomm top5 item index[12, 39, 44, 17, 38].
 21 user[20] recomm top5 item index[39, 44, 4, 31, 17].
 22 user[21] recomm top5 item index[39, 12, 17, 5, 25].
 23 user[22] recomm top5 item index[5, 18, 0, 44, 35].
 24 user[23] recomm top5 item index[39, 17, 12, 24, 44].
 25 user[24] recomm top5 item index[5, 39, 9, 44, 24].
 26 user[25] recomm top5 item index[18, 12, 47, 45, 5].
 27 user[26] recomm top5 item index[12, 24, 44, 41, 45].
 28 user[27] recomm top5 item index[5, 47, 12, 8, 25].
 29 user[28] recomm top5 item index[25, 31, 18, 5, 33].
 30 user[29] recomm top5 item index[18, 12, 25, 5, 47].
 31 user[30] recomm top5 item index[12, 5, 3, 39, 23].
 32 user[31] recomm top5 item index[18, 25, 4, 5, 8].
 33 user[32] recomm top5 item index[12, 47, 39, 44, 25].
 34 user[33] recomm top5 item index[12, 39, 24, 47, 9].
 35 user[34] recomm top5 item index[12, 18, 31, 5, 25].
 36 user[35] recomm top5 item index[5, 47, 25, 18, 3].
 37 user[36] recomm top5 item index[12, 44, 31, 39, 4].
 38 user[37] recomm top5 item index[39, 17, 24, 47, 19].
 39 user[38] recomm top5 item index[24, 39, 12, 11, 47].
 40 user[39] recomm top5 item index[12, 47, 18, 39, 5].
 41 user[40] recomm top5 item index[4, 31, 12, 44, 2].
 42 user[41] recomm top5 item index[18, 12, 45, 24, 8].
 43 user[42] recomm top5 item index[12, 44, 23, 46, 2].
 44 user[43] recomm top5 item index[12, 39, 44, 17, 5].
 45 user[44] recomm top5 item index[5, 47, 0, 12, 18].
 46 user[45] recomm top5 item index[25, 12, 39, 26, 44].
 47 user[46] recomm top5 item index[17, 44, 24, 43, 15].
 48 user[47] recomm top5 item index[39, 17, 44, 24, 15].
 49 user[48] recomm top5 item index[5, 18, 47, 12, 0].
 50 user[49] recomm top5 item index[12, 5, 18, 31, 3].
 51 user[50] recomm top5 item index[25, 3, 5, 23, 49].
 52 user[51] recomm top5 item index[12, 47, 44, 25, 17].
 53 user[52] recomm top5 item index[24, 17, 44, 38, 15].
 54 user[53] recomm top5 item index[12, 31, 18, 9, 30].
 55 user[54] recomm top5 item index[39, 47, 44, 25, 3].
 56 user[55] recomm top5 item index[12, 39, 24, 45, 28].
 57 user[56] recomm top5 item index[5, 47, 25, 0, 12].
 58 user[57] recomm top5 item index[39, 44, 17, 24, 19].
 59 user[58] recomm top5 item index[12, 31, 4, 30, 18].
 60 user[59] recomm top5 item index[12, 24, 38, 47, 11].
 61 user[60] recomm top5 item index[18, 3, 31, 2, 33].
 62 user[61] recomm top5 item index[12, 24, 47, 19, 5].
 63 user[62] recomm top5 item index[5, 25, 18, 47, 12].
 64 user[63] recomm top5 item index[39, 12, 17, 44, 19].
 65 user[64] recomm top5 item index[12, 39, 5, 47, 44].
 66 user[65] recomm top5 item index[12, 24, 38, 45, 41].
 67 user[66] recomm top5 item index[12, 44, 15, 41, 19].
 68 user[67] recomm top5 item index[12, 18, 9, 30, 8].
 69 user[68] recomm top5 item index[39, 47, 45, 44, 5].
 70 user[69] recomm top5 item index[12, 24, 19, 45, 44].
 71 user[70] recomm top5 item index[12, 5, 25, 3, 47].
 72 user[71] recomm top5 item index[25, 18, 47, 44, 3].
 73 user[72] recomm top5 item index[12, 4, 31, 44, 30].
 74 user[73] recomm top5 item index[18, 47, 9, 11, 8].
 75 user[74] recomm top5 item index[39, 17, 12, 24, 38].
 76 user[75] recomm top5 item index[12, 24, 47, 44, 5].
 77 user[76] recomm top5 item index[18, 5, 47, 25, 12].
 78 user[77] recomm top5 item index[39, 47, 45, 6, 17].
 79 user[78] recomm top5 item index[12, 0, 17, 35, 6].
 80 user[79] recomm top5 item index[12, 30, 9, 39, 2].
 81 user[80] recomm top5 item index[12, 39, 47, 24, 31].
 82 user[81] recomm top5 item index[12, 25, 5, 47, 3].
 83 user[82] recomm top5 item index[12, 18, 9, 47, 5].
 84 user[83] recomm top5 item index[39, 17, 44, 43, 26].
 85 user[84] recomm top5 item index[39, 17, 26, 12, 5].
 86 user[85] recomm top5 item index[5, 47, 18, 12, 6].
 87 user[86] recomm top5 item index[12, 47, 24, 44, 5].
 88 user[87] recomm top5 item index[18, 9, 8, 47, 31].
 89 user[88] recomm top5 item index[39, 12, 17, 44, 43].
 90 user[89] recomm top5 item index[12, 39, 44, 17, 47].
 91 user[90] recomm top5 item index[5, 18, 47, 12, 31].
 92 user[91] recomm top5 item index[12, 44, 31, 17, 2].
 93 user[92] recomm top5 item index[12, 31, 9, 5, 25].
 94 user[93] recomm top5 item index[18, 5, 9, 8, 12].
 95 user[94] recomm top5 item index[39, 12, 24, 38, 17].
 96 user[95] recomm top5 item index[39, 12, 5, 26, 47].
 97 user[96] recomm top5 item index[18, 47, 5, 9, 12].
 98 user[97] recomm top5 item index[39, 12, 6, 17, 0].
 99 user[98] recomm top5 item index[17, 19, 47, 41, 15].
100 user[99] recomm top5 item index[12, 39, 47, 5, 24].

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM