Recommender Engine Action Set
The recBpr Action
Creating personalized recommendations of items for users on the basis of users’ implicit feedback (such as web clicks or purchase history) is a recurring and important problem for recommender systems. Bayesian personalized ranking (BPR) is a common method that is designed specifically to optimize ranking and has shown superior performance compared to the standard learning techniques that are widely used to analyze explicit feedback. The recBpr action accepts data that include the interactions of users with items as well as auxiliary features. It supports two training models, matrix factorization (MF) and factorization machines (FM), under the BPR optimization criteria.
In an implicit feedback scenario, an observation or event consists of a user (where
), an item (where
), and a vector of auxiliary features (where
), where U, I, and Z denote the index set of all users, the index set of all items, and the index set of all possible auxiliary features, respectively. The auxiliary features can include user features, item features, and possibly context features. Assume that
is the observed implicit feedback data set. Let
denote the index set of items that user u has observed. Then, the training data set that is derived from the observed data set is defined as
. The task of the recommender system is to provide a user u with a personalized ranking of all pairs of items.
Bayesian personalized ranking that uses matrix factorization has been introduced by Rendle et al. (2012). This method can be generalized with the model parameters, , and the score function,
. The objective function of maximizing the posterior density of
is proposed as follows:
where and
is the sigmoid function. The method of stochastic gradient descent (SGD) or the variants Adam and AdamW are applied to solve the optimization problem.
In the typical matrix factorization, a target matrix is approximated by the matrix product of two low-rank matrices, and
, where k is the rank of approximation, also called the number of latent factors. Each row of
,
, can be considered a k-dimensional latent vector for a user u, and similarly, each row of
,
, can be considered a k-dimensional latent feature vector for an item i. Therefore, the model parameters for matrix factorization are
. Assume that
is the input vector that corresponds to the event
. Then the score function can be written as
You can enhance the score function by using the factorization machine model (Rendle 2012) when you take account of the auxiliary features. For simplicity, let be a feature vector for the event
, where
is a one-hot vector for user
and
is a one-hot vector for item
. The corresponding model parameters are represented by
. The score function of the FM model is formed as