RECENGINE Procedure

BPR Statement

  • BPR <options>;

The BPR statement specifies the parameters of the Bayesian personalized ranking method.

You can specify the following options:

CONVTOL=number

specifies the convergence tolerance, which is the minimum change in loss value that is required in order to be considered a meaningful improvement in the optimization process.

By default, CONVTOL=0.0001.

CONVWINSIZE=number

specifies the number of consecutive iterations without improvement in loss before the optimization process stops. If you specify CONVWINSIZE=0, the convergence criterion is disabled.

By default, CONVWINSIZE=3.

LEARNSTEP=number

specifies the learning step size for the stochastic gradient descent (SGD) algorithm, where number is a positive real number. The learning step size controls the amount by which the factors are updated at each iteration.

By default, LEARNSTEP=0.01. This value can be tuned with the AUTOTUNE statement.

MAXITER=number

specifies the maximum number of epochs for the algorithm to perform, where number is an integer greater than or equal to 1. In each iteration of the SGD method, the factors are recomputed.

By default, MAXITER=30. This value can be tuned with the AUTOTUNE statement.

MINIBATCHSIZE=number

specifies the number of observation samples to be used in each step of the stochastic gradient descent (SGD) algorithm. By default, the minibatch size is calculated automatically as a function of relevant factors, including data size and gradient sparsity.

NFACTOR=number

specifies the number of latent factors to be estimated, where number is an integer.

By default, NFACTOR=3. This value can be tuned with the AUTOTUNE statement.

OPTIMIZER=ADAM | ADAMW | SGD

specifies the optimization algorithm to use. You can specify one of the following values:

ADAM

uses the adaptive moments (Adam) variant of the stochastic gradient descent solver.

ADAMW

uses the Adam variant with decoupled weight decoy.

SGD

uses the stochastic gradient descent solver.

By default, OPTIMIZER=ADAMW.

REGL2=number

specifies the regularization parameter for the BPR optimization.

By default, REGL2=0.01. This value can be tuned with the AUTOTUNE statement.

SEED=number

specifies an integer that is used to start the pseudorandom number generator. This option enables you to reproduce the same output, but only when you specify NTHREADS=1 in the PROC RECENGINE statement. If you do not specify a seed or you specify a value less than or equal to 0, the seed is generated by reading the time of day from the computer’s clock.

Last updated: July 02, 2026