Giter Site home page Giter Site logo

probabilistic-matrix-factorization-in-python's Introduction

Probabilistic matrix factorization (PMF) in Python

Parameters:

num_feat: Number of latent features,
epsilon: learning rate,
_lambda: L2 regularization,
momentum: momentum of the gradient,
maxepoch: Number of epoch before stop,
num_batches: Number of batches in each epoch (for SGD optimization),
batch_size: Number of training samples used in each batches (for SGD optimization)

Methods:

fit(train_tuple, val_tuple)

Fit the model with train_tuple and evaluate RMSE on both train and validation data.
Input tuple format: (userID, movieID, rating) # 0-index ID is recommended
Output: U and V matrices, RMSE Error on Train and Validation after each epoch.

predict(userID)

Predict rating of all movies for the given user.

set_params(parameter_dict)

Set parameters by providing a parameter dictionary.

Helper function:

def wrap_Parameters(num_feat, epsilon, _lambda, momentum, maxepoch, num_batches, batch_size):

return {"num_feat": num_feat, "epsilon":epsilon, "_lambda":_lambda, "momentum":momentum, "maxepoch":maxepoch, "num_batches":num_batches, "batch_size":batch_size}

Reference:

  1. Mnih, A., & Salakhutdinov, R. (2007). Probabilistic matrix factorization. In Advances in neural information processing systems (pp. 1257-1264).
  2. Salakhutdinov, R. Probabilistic matrix factorization in Matlab. http://www.cs.toronto.edu/~rsalakhu/code_BPMF/pmf.m.

probabilistic-matrix-factorization-in-python's People

Watchers

James Cloos avatar LZ avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.