Decomposer.MF_Tutorial#

Implementation of Matrix Factorization in Python albertauyeung/matrix-factorization-in-python

class MF(R, K, alpha, beta, iterations)#

Bases: object

Perform matrix factorization to predict empty entries in a matrix.

Arguments - R (ndarray) : user-item rating matrix - K (int) : number of latent dimensions - alpha (float) : learning rate - beta (float) : regularization parameter

full_matrix()#

Computer the full matrix using the resultant biases, P and Q

get_rating(i, j)#

Get the predicted rating of user i and item j

mse()#

A function to compute the total mean square error

sgd()#

Perform stochastic graident descent

train()#