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 u element of upper U), an item (where i element of upper I), 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, bold italic theta, and the score function, . The objective function of maximizing the posterior density of bold italic theta 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, upper V Subscript upper U Baseline colon StartAbsoluteValue upper U EndAbsoluteValue times k and upper V Subscript upper I Baseline colon StartAbsoluteValue upper I EndAbsoluteValue times k, where k is the rank of approximation, also called the number of latent factors. Each row of upper V Subscript upper U, v Subscript u, can be considered a k-dimensional latent vector for a user u, and similarly, each row of upper V Subscript upper I, v Subscript i, can be considered a k-dimensional latent feature vector for an item i. Therefore, the model parameters for matrix factorization are bold italic theta colon equals left parenthesis upper V Subscript upper U Baseline comma upper V Subscript upper I Baseline right parenthesis. Assume that bold italic x Subscript u comma i is the input vector that corresponds to the event left parenthesis u comma i right parenthesis. Then the score function can be written as

f left parenthesis bold italic x Subscript u comma i Baseline vertical bar bold italic theta right parenthesis equals sigma summation Underscript f equals 1 Overscript k Endscripts v Subscript u comma f Baseline v Subscript i comma f

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

Last updated: September 01, 2026