Deep Learning | Recommender Systems with Collaborative filtering

Chris
3 min readOct 30, 2022

--

Collaborative filtering:

Collaborative filtering uses the similarity between users and items simultaneously to provide recommendations. They are namely recommending an item to user A base on the interests of a similar user B.

Two Tower model:

https://www.youtube.com/watch?v=jz0-satrmrA&list=PLQY2H8rRoyvy2MiyUBz5RWZr5MPFkV3qz&index=3

The word "tower" means that the fully connected layers above the input layer follow a tower pattern, which means the width of these layers gradually decreases.

The tower on the user of the left maps features user embeddings called query tower. The tower on the right map features item embeddings called candidate tower.

The model's output is the dot product of user embedding and item embedding. This model corresponds to the matrix factorization model.

Collaborative filtering using Matrix Factorization:

We illustrate 2D embeddings for the users and movies with matrix form on the right; our goal is to make sure that we can learn these embeddings so that the predictive feedback matrix is as close to the actual ground feedback matrix as possible.

Collaborative filtering using Matrix Factorization

A: real data matrix

U, V: numerical feature

A’:predicted data matrix

penalty(error):

K:embedding_dimension

To minimize the error:

  • SGD (Stochastic Gradient Descent): more flexible on the loss function
  • WALS (Weighted Alternating Least Squares): converge faster than SGD

How to deal with unobservable item: Weighted Matrix Factorization

https://developers.google.com/machine-learning/recommendation/collaborative/matrix

Unobservable data set to default as 0, and W0 as the hyperparameter to be tuned.

The whole function is like this:

--

--