Gorse uses matrix factorization[1] as the collaborative filtering algorithm to provide personalized recommendations. Matrix factorization is a widely used technique in recommender systems that models user-item interactions by representing both users and items in a shared latent space.
In matrix factorization, items and users are represented by vectors. The probability that a user u likes an item i is predicted by the dot product of two vectors.
y^ui=puTqi
where pu is the embedding vector of the user u, and qi is the embedding vector of the item i. The model of matrix factorization is simple, but there is more than one training algorithm.
BPR[2] (Bayesian Personalized Ranking) is a pairwise training algorithm. The training data for BPR consist of a set of triples:
Ds={(u,i,j)∣i∈Iu∧j∈I∖Iu}
The semantics of (u,i,j)∈DS is that user u is assumed to prefer i over j. The negative cases are regarded implicitly.
The Bayesian formulation of finding the correct personalized ranking for all items is to maximize the following posterior probability where Θ represents the parameter vectors of the matrix factorization model
p(Θ∣>u)∝p(>u∣Θ)p(Θ)
where >u is the desired but latent preference for user u. All users are presumed to act independently of each other. BPR also assumes the ordering of each pair of items (i,j) for a specific user is independent of the ordering of every other pair. Hence, the above user-specific likelihood function p(>u∣Θ) can first be rewritten as a product of single densities and second be combined for all users u∈U.
u∈U∏p(>u∣Θ)=(u,i,j)∈Ds∏p(i>uj∣Θ)
where p(i>uj∣Θ)=σ(y^uij) and y^uij=y^ui−y^uj.
For the parameter vectors, BPR introduces a general prior density p(Θ) which is a normal distribution with zero mean and variance-covariance matrix ΣΘ.
p(Θ)∼N(0,ΣΘ)
where ΣΘ=λΘI. Then the optimization criterion for personalized ranking is
Rendle, Steffen, et al. "BPR: Bayesian personalized ranking from implicit feedback." Proceedings of the Twenty-Fifth Conference on Uncertainty in Artificial Intelligence. 2009. ↩︎
He, Xiangnan, et al. "Fast matrix factorization for online recommendation with implicit feedback." Proceedings of the 39th International ACM SIGIR conference on Research and Development in Information Retrieval. 2016. ↩︎