Developer Guide and Reference

  • 2021.3
  • 06/28/2021
  • Public Content
Contents

Implicit Alternating Least Squares

The library provides the Implicit Alternating Least Squares (implicit ALS) algorithm [Fleischer2008], based on collaborative filtering.

Details

Given the input dataset LaTex Math image. of size LaTex Math image., where m is the number of users and n is the number of items, the problem is to train the Alternating Least Squares (ALS) model represented as two matrices:
X
of size LaTex Math image., and
Y
of size LaTex Math image., where
f
is the number of factors. The matrices
X
and
Y
are the factors of low-rank factorization of matrix
R
:
LaTex Math image.
Initialization Stage
Initialization of the matrix Y can be done using the following method: for each LaTex Math image. LaTex Math image. and LaTex Math image. are independent random numbers uniformly distributed on the interval LaTex Math image., LaTex Math image..
Training Stage
The ALS model is trained using the implicit ALS algorithm [Hu2008] by minimizing the following cost function:
LaTex Math image.
where:
  • LaTex Math image. indicates the preference of user u of item i:
    LaTex Math image.
  • LaTex Math image. is the threshold used to define the preference values. LaTex Math image. is the only threshold valu supported so far.
  • LaTex Math image., LaTex Math image. measures the confidence in observing LaTex Math image.
  • LaTex Math image. is the rate of confidence
  • LaTex Math image. is the element of the matrix
    R
  • LaTex Math image. is the parameter of the regularization
  • LaTex Math image., LaTex Math image. denote the number of ratings of user
    u
    and item
    i
    respectively
Prediction Stage
Prediction of Ratings
Given the trained ALS model and the matrix
D
that describes for which pairs of factors
X
and
Y
the rating should be computed, the system calculates the matrix of recommended ratings Res: LaTex Math image., if LaTex Math image., LaTex Math image.; LaTex Math image..

Initialization

For initialization, the following computation modes are available:

Computation

The following computation modes are available:

Examples

C++ (CPU)
Batch Processing:
Distributed Processing:
Java*
There is no support for Java on GPU.
Batch Processing:
Distributed Processing:
Python*
Batch Processing:

Performance Considerations

To get the best overall performance of the implicit ALS recommender:
  • If input data is homogeneous, provide the input data and store results in homogeneous numeric tables of the same type as specified in the algorithmFPType class template parameter.
  • If input data is sparse, use CSR numeric tables.
Product and Performance Information
Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex​.
Notice revision #20201201

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.