From c427ffa5782d7410387e98a3998a491b0bc51ccb Mon Sep 17 00:00:00 2001 From: zhaozhiyong19890102 Date: Fri, 1 Dec 2017 23:19:08 +0800 Subject: [PATCH] Update FM_train.py --- Chapter_3 Factorization Machine/FM_train.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Chapter_3 Factorization Machine/FM_train.py b/Chapter_3 Factorization Machine/FM_train.py index ba3d294..204ce8a 100644 --- a/Chapter_3 Factorization Machine/FM_train.py +++ b/Chapter_3 Factorization Machine/FM_train.py @@ -83,7 +83,7 @@ def stocGradAscent(dataMatrix, classLabels, k, max_iter, alpha): # 计算损失函数的值 if it % 1000 == 0: print "\t------- iter: ", it, " , cost: ", \ - getCost(getPrediction(np.mat(dataTrain), w0, w, v), classLabels) + getCost(getPrediction(np.mat(dataMatrix), w0, w, v), classLabels) # 3、返回最终的FM模型的参数 return w0, w, v