Table of Contents #
We implemented three constant baselines, two memory-based collaborative filtering algorithms, and several state-of-the-art ones, mainly implemented by Matrix Factorization.
Predicting unknown ratings, this group of metrics assigns a constant estimate, regardless of the target user or item, or neither. These metrics are extremely fast to compute, but do not produce good results in general. These can be used for baselines, which should be overcome by any algorithm.
A constant (usually the median of possible ratings) is assigned for every prediction.
Each rating is predicted by average of all available ratings.
Each rating is predicted by average of the target user's available ratings on every item.
Each rating is predicted by average of the target item's available ratings by all users.
Randomly assign any rating between the minimum and the maximum possible rating score.
Memory-based Collaborative Filtering
Memory-based CF algorithms load the entire data on the memory, and make prediction based on similar users or items to the target user or item. Algorithms in this group do not explicitly build a model. Instead, they use the data for each query. Thus, they do not take learning time, but take longer time for prediction phase. Specific algorithm can be varied with choice of similarity measure. We provide Pearson Correlation, Vector Cosine, Mean Square Difference, and Mean Absolute Difference.
In user-based CF algorithm, a rating for an item is estimated based on other users' ratings on the target item. For this task, a weigth factor based on user similarity is considered. That is, ratings by users who have similar interest to the target user have larger influence on determining estimation. This algorithm is one of popular traditional collaborative filtering methods, as it is relatively fast, but achieves reasonable accuracy in prediction.
Item-based CF algorithm first analyze the rating matrix to identify relationships between items. Then, it uses these relationships to predict ratings for unseen items. Sarwar et al.  argues that this algorithm is scalable to larger data as well as achieves better accuracy compared to user-based CF.
In real situation, it is common that the rating matrix is extremely sparse. In this case, we have very little number of ratings of common users or for common items. In order to overcome this problem, this extension assigns a default vote on every missing rating, enabling making use of every rating for estimation.
Another extension of memory-based CF is inverse user frequency. In this setting, weights for universally liked items are degraded, as they are less meaningful in capturing similarity.
Slope-one is a relatively recent memory-based algorithm, aimed to easy and simple implementation with reasonable accuracy. It precomputes average difference between the ratings of one item and another for users who rated both, and use the information to predict unseen ratings in the form of f(x) = x + b. It has empiricaly shown that Slope-One achieves comparable accuracy with other slower memory-based CF algorithms.
User-based Collaborative Filtering[1,2]
Item-based Collaborative Filtering
Extension: Default Voting
Extension: Inverse User Frequency
Latent Semantic Models using Matrix Factorization
Contrast to memory-based CF algorithms, ones in this group explicitly build a model during the learning phase, by recognizing patterns in the training data. After the learning phase, they use the model to predict ratings of given queries. Many recent achievement of precise prediction used this approach. Specifically, these methods factorize the rating matrix into two low-rank matrices: user profile and item profile. They tend to take longer time compared to previous ones, but claimed to achieve better accuracy.
Regularized SVD (Singular Value Decomposition) minimizes squared error between actual ratings and predicted estimations for all available votes. In order to control overfitting issue, it adds regularization terms both for user and item profiles. For minimization process, it uses gradient descent. With a proper choice of parameters, this algorithm is known to achieve good accuracy.
NMF also factorizes the rating matrix into user and item profiles, but it has one more restriction: both low-rank profile matrices should have only positive values in them. This method uses multiplicative update rules for minimizing Euclidean distance or Kullback-Leibler divergence between the actual ratings and estimation. Lee and Seung  proved convergence of this algorithm mathematically.
PMF adopts a probabilistic linear model with Gaussian observation noise for representing latent features both for users and items. Salakhutdinov  argues that this can be viewed as a probabilistic extension of the SVD model.
This algorithm applies a fully Bayesian treatment of PMF model in which model capacity is controlled automatically by integrating over all model parameters and hyperparameters. Salakhutdinov  uses Markov Chain Monte Carlo (MCMC) method for training BPMF, and claims good performance on Netflix dataset.
This algorithm develops a non-linear probabilistic matrix factorization using Gaussian process latent variable models. The model is optimized using stochastic gradient descent method, allownig to apply Gaussian processes to data sets with millions of observations without approximate methods.
With matrix factorization form, this method minimizes various ranked loss functions, which preserve relative order of preference between two items rated by a same user.
Non-negative Matrix Factorization (NMF)[7, 8]
Probabilistic Matrix Factorization (PMF)
Bayesian Probabilistic Matrix Factorization (BPMF)
Non-linear Probabilistic Matrix Factorization (NLPMF)
Local Low-Rank Matrix Approximation
LLORMA  is a powerful and scalable matrix approximation tool. Under the assumption that the target matrix is locally in low-rank, it learns several local models on different anchor points. A convex combination using Nadaraya-Watson regression gives a reconstruction of the target matrix.
Parallel LLORMA learns each local model independently in parallel. By taking advantage of multi-cores, it achieves high accuracy without taking long time.
It minimizes squared error between the convex combination of q local models and observed entries. All local models are learned together, minimizing the squared error exactly. Although it does not take advantage of multi-cores, it may achieve better accuracy than parallel version.
It minimizes various ranked loss functions, which preserve relative order of preference between two items rated by a same user. All local models are learned together, but unlike the singleton version, it runs in parallel.
Singleton Parallel LLORMA
Singleton Global LLORMA
Paired Global LLORMA (Local Collaborative Ranking)
Other State-of-the-art Algorithms
Besides memory-based and latent semantic models, several other recommendation algorithms were designed and achieved good performance. We do provide some of those state-of-the-art algorithms, listed below.
Yu  proposes efficient implementation of nonparametric matrix factorization methods. Nonparametric methods are appealing due to its flexibility in modeling complex data. With his scalable implementation, fast NPCA is claimed to achieve good performance on large scale data.
Fast Nonlinear Principal Component Analysis (NPCA)
Evaluation Metrics #
Many researchers have suggested how to evaluate recommender systems or collaborative filtering algorithms. Gunawardana and Shani  categorizes them into three groups according to the main task: predicting ratings, optimizing utility, and recommending good items. As they argue, a proper metric should be used in order to evaluate the target system correctly. We do provide several popular evaluation metrics, including RMSE, MAE, rank-based metrics, as well as our own evaluation scheme.
(N/A indicates that the algorithm is Not Available in the corresponding toolkit.)
Here are some observations about the benchmark test:
Comparison of Predicted Ratings
Evaluation metrics in this category have heavily used for comparing accuracy of predicting unseen ratings. Note that p indicates predicted rating, while r observed true rating. rmax and rmin mean maximum and minimum observed ratings, respectively. Although these metrics have used frequently in literature, Gunawardana and Shani  argues that they are limited in that they do not capture the fact that the space of ratings is not actually uniform.
NMAE normalizes MAE measure for the purpose of direct comparison between two systems using different rating scale.
In contrast to the standard MAE and RMSE, the asymmetric loss captures the fact that recommending bad movies as good movies is worse than recommending good movies as bad.
where the loss is asymmetric such that loss(5,1) > loss(1,5).
The matrix below shows one example of the asymmetric loss when minRate is 1 and maxRate is 6.
The rows are predicted ratings and the columns are real ratings. For example,
Root of the Mean Square Error (RMSE)
Mean Absolute Error (MAE)
Normalized Mean Absolute Error (NMAE)
Unlike the previous category, Rank-based Metrics use relative order of recommended items rather than exact scores of them.
Suppose we have a list of recommended items, and want to know how likely the user will actually retrieve the recommended items. Assuming an exponential decay with a half-life of alpha, it evaluates how many actually preferred items are located in the front of recommended list. Overall score is in relative scale to the maximum possible score of the target user. Gunawardana and Shani  argues that this is a proper measure when the recommender system is aimed to optimize utility.
NDCG is widely used for measuring effectiveness of a web search engine or other information retrieval applications. Discounted cumulative gain (DCG) measures the usefulness of an item based on its rank in a recommended list. NDCG normalizes the DCG in order to compensating varying length of recommended item list. For this, DCG score is divided by maximum possible gain with the given list. This is conceptually similar to HLU, but gives slightly different result.
The kendall's Tau distance between two rankings x, y over n items is the number of discordant pairs.
where I is the indicator function and xi is the rank of item i in x.
The Spearman's distance is the square of Euclidean distance between two rankings interpreted as vectors.
Half-Life Utility (HLU)
Normalized Discounted Cumulative Gain (NDCG)
We present benchmark performance of our toolkit by comparing accuracy measure and computation time with another recommender system toolkit MyMedia. We chose MyMedia to compare with since provided features (both recommendation algorithms and evaluation measures) overlap the most. Although it is originally in C#, we used Java version of MyMedia for fair comparison. We used a machine with Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz and 16GB of main memory. We used Movielens 1M dataset with random split of 80% train and 20% test. All the parameters affecting computation time (e.g, neighborhood size, learning rate, and number of iterations) were set equally for both toolkits. Some parameters adjustable only in one toolkit were set as default.
|Algorithm||MAE||RMSE||Train Time||Test Time|
Here are some observations about the benchmark test:
- The result indicates that MAE and RMSE values are very similar in most algorithms. This supports that our implementation is correct, assumming that MyMedia implementation is correct. (One exception is Random, where MyMedia shows much worse accuracy. We do not think this is a big deal since Random is a very simple baseline.)
- Implementation of User-based and Item-based CF is a little bit different in each toolkit. MyMedia uses memoization technique, remembering previously used similarity values in main memory. This reduces computation time, while dramatically increases memory consumption. For example, the User-based CF cannot run without expanding memory to 2GB in Java. On the other hand, PREA supports using precalculated user/item similarity. Using this makes the computation much faster, as indicated in User-based row. If it is not used, the computation takes about twice than memoization used in MyMedia, as indicated in Item-based row.
- PREA is faster than MyMedia for some algorithms like Slope-one, while it is the opposite for other algorithms like Regularized SVD. In general, however, the performance difference is at most about twice to three times at most. We believe that both toolkits have some room to improve performance a little bit, but it may not that big.
- Algorithms which are not available in MyMedia do not take time much longer than Regularized SVD. This means that those algorithms are efficiently implemented for practical use.
- We note that this table is not proper for comparing accuracy of each algorithm, since the parameters are not perfectly tuned in some algorithms. We provide this table for the purpose of verifying correct implementation and comparing computation time between the two toolkits.
- Xiaoyuan Su and Taghi M. Khoshgoftaar, A survey of Collaborative Filtering Techniques, Advances in Artificial Intelligence Volume 2009, Article ID 421425, 2009.
- Gediminas Adomavicius and Alexander Tuzhilin, Toward the Next Generation of Recommender Systems: A Survey of the State-of-the-Art and Possible Extensions, IEEE Transactions on Knowledge and Data Engineering, Vol. 17, No. 6, 2005.
- Badrul Sarwar et al, Item-based Collaborative Filtering Recommendation Algorithms, Proceedings of the international conference on World Wide Web 2001, Hong Kong, 2001.
- John S. Breese and David Heckerman and Carl Kadie, Empirical Analysis of Predictive Algorithms for Collaborative Filtering, Proceedings of the 14th conference on Uncertainty in Artificial Intelligence, 1998.
- Daniel Lemire and Anna Maclachlan, Slope One Predictors for Online Rating-Based Collaborative Filtering, Society for Industrial Mathematics, 05:471–480, 2005.
- Arkadiusz Paterek, Improving Regularized Singular Value Decomposition Collaborative Filtering, Proceedings of KDD Cup and Workshop 2007, 2007.
- Daniel D. Lee and H. Sebastian Seung, Learning the parts of Objects by Non-negative Matrix Factorization, Letters to Nature, Vol. 401, 1999.
- Daniel D. Lee and H. Sebastian Seung, Algorithms for Non-negative Matrix Factorization, Advances in Neural Information Processing Systems, 2001.
- Ruslan Salakhutdinov and Andriy Mnih, Probabilistic Matrix Factorization, Advances in Neural Information Processing Systems 20, Cambridge, MA: MIT Press, 2008.
- Ruslan Salakhutdinov and Andriy Mnih, Bayesian Probabilistic Matrix Factorization using Markov Chain Monte Carlo, Proceedings of the 25th International Conference on Machine Learning, 2008.
- Neil D. Lawrence and Raquel Urtasun, Non-linear Matrix Factorization with Gaussian Processes, Proceedings of the 26th International Conference on Machine Learning, 2009.
- Kai Yu et al, Fast Nonparametric Matrix Factorization for Large-scale Collaborative Filtering, Proceedings of the 32nd international ACM SIGIR conference on Research and development in information retrieval, 2009.
- Jason D. M. Rennie and Nathan Srebro, Fast Maximum Margin Matrix Factorization, Proceedings of the 22nd International Conference on Machine Learning, 2005.
- M. Sun and G. Lebanon and P. Kidwell, Estimating Probabilities in Recommendation Systems, Proceedings of the fourteenth international conference on Artificial Intelligence and Statistics, 2011.
- Asela Gunawardana and Guy Shani, A Survey of Accuracy Evaluation Metrics of Recommendation Tasks, The Journal of Machine Learning Research, Volume 10, 2009.
- Kalervo Jarvelin and Jaana Kekalainen, Cumulated gain-based evaluation of IR techniques, ACM Transactions on Information Systems 20(4), 422–446, 2002.
- J. I. Marden, Analyzing and modeling rank data, CRC Press, 1996.
- Joonseok Lee and Seungyeon Kim and Guy Lebanon and Yoram Singer, Local Low-Rank Matrix Approximation, Proceedings of the 30th International Conference on Machine Learning, 2013.
- Joonseok Lee and Samy Bengio and Seungyeon Kim and Guy Lebanon and Yoram Singer, Local Collaborative Ranking, Proceedings of the 23rd International World Wide Web Conference (WWW), 2014.