This repository analyzes the movie recommendation dataset by Probabilistic Matrix Factorization.
MovieLens Latest Datasets are downloaded here https://grouplens.org/datasets/movielens/ In the analysis, small dataset (100k ratings applied to 9,000 movies by 600 users) is tested. To test model capability quickly, partial movies with id less than 400 (super-mini-MovieLens) are tested.
Probabilistic Matrix Factorization is trained by MAP (maximum a posterior) estimation.
The goal of Matrix Factorization is to find two matrices
Based on the Columbia University Prof. John Paiskley's lecture (http://www.columbia.edu/~jwp2128/Teaching/W4721/Spring2017/slides/lecture_3-30-17.pdf) and their page 19, MAP inference is estimated by coordinate ascent algorithm.
Under PMF, model is coded under the class inheritance of sklearn BaseEstimator. To deal with sparse matrix, math operation relies on scipy.sparse lil_matrix and coo_matrix
Leveraging GridSearchCV, two hyperparameters (features dimension, reguralization term of variance of matrix R =$\lambda \sigma^2$) are tuned by 3 folds cross valication.
Grid search is computed with 4 processes in 16GB CPU mac book pro and it takes 17min 12s to test 24 combinations in total.
This is submitted to Statistical Machine Learning coarse (2020 Summer) in the University of Tokyo