f3fbdef37a98ef1cab7163f01f00eaccb563771c,algorithm/rating/SVD.py,SVD,buildModel,#SVD#,13

Before Change


            for triple in self.dao.triple:
                u,i,r = triple
                u = self.dao.user[u]
                i = self.dao.item[i]
                error = r-self.P[u].dot(self.Q[i])-self.dao.globalMean-self.Bi[i]-self.Bu[u]
                self.loss+=error**2
                //update latent vectors
                p = self.P[u].copy()

After Change


            for triple in self.dao.triple:
                u,i,r = triple
                u = self.dao.getUserId(u)
                i = self.dao.getItemId(i)
                error = r-self.P[u].dot(self.Q[i])-self.dao.globalMean-self.Bi[i]-self.Bu[u]
                self.loss+=error**2
                p = self.P[u].copy()
                q = self.Q[i].copy()
                self.loss += self.regU * p.dot(p) + self.regI * q.dot(q)
                bu = self.Bu[u]
                bi = self.Bi[i]
                self.loss += self.regB*bu**2 + self.regB*bi**2
                //update latent vectors
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: Coder-Yu/RecQ
Commit Name: f3fbdef37a98ef1cab7163f01f00eaccb563771c
Time: 2016-11-24
Author: coderyy@outlook.com
File Name: algorithm/rating/SVD.py
Class Name: SVD
Method Name: buildModel


Project Name: Coder-Yu/RecQ
Commit Name: f3fbdef37a98ef1cab7163f01f00eaccb563771c
Time: 2016-11-24
Author: coderyy@outlook.com
File Name: algorithm/rating/BasicMF.py
Class Name: BasicMF
Method Name: buildModel


Project Name: Coder-Yu/RecQ
Commit Name: f3fbdef37a98ef1cab7163f01f00eaccb563771c
Time: 2016-11-24
Author: coderyy@outlook.com
File Name: algorithm/rating/SVD.py
Class Name: SVD
Method Name: predict