I'm building a recommender system where the number of products is rather low (around 50), and we can assume it'll stay the same for a long time.

I'm looking at two different way of tackling the problem:

  • Using a matrix factorization technique.
  • Treating it as a multi-class classification problem with a target of 50 different possible values. The features I'm using are the ones that the matrix factorization technique uses implicitly:
    • Number of times a user has bought product 1.
    • Number of times a user has bought product 2.
    • ...
    • Number of times a user has bought product 50.

In addition, I'm also able to add user features for the classification approach, like age, gender, and localization, among others.

Is there any reason/advantages to using the matrix factorization technique in this case? What are the advantages/disadvantages of both methods?


2 Answers 2


Disadvantage of the matrix factorization

  1. how to encode the feature ? should it be binary (present and absent) or rather integer (for example summing up number of signals user have interacted with item_i)
  2. unfortunately you can't integrate meta data on your matrix factorization, neither on the item nor on the user
  3. the cold start - you don't know how to offer new items or what to offer to new users. So you would have to setup up a bandit model in addition

on the other hand,

  1. easy to deploy and easily scalable
  2. you wont have much challenges when it comes to feature engineering

challenges for the multi-class classification:

  1. taking care of time in training/evaluating the model: feature engineering is a bit tougher (this is also the case for matrix factorization) but here you also have to make sure, your feature engineering is respecting the time. For example, if you have a feature how many times user_i has purchased item_j, you have to make sure the test labels (buying item j) is not already encoded in the feature set (if you say the user already has purchased item or preferred that price) - otherwise there would be a huge data leak in your model.

  2. perhaps in your data you will have rows belong to a single user who has purchased multiple items - so you have to take care of these mixed effects. otherwise you have to somehow make sure your model learns about each individual user (if you want to have an individual-level high-precision recommender)! imagine a user has purchased 25 items before. then you have 25 rows, right ?

  3. deployment is gonna be a bit harder as you have to do feature engineering also for upcoming data. hopefully you won't have issue with memory usage but these are serious side effects of models that need feature engineering.

  • $\begingroup$ What's the issue of having 25 rows per customer? What do you mean by mixed effects? $\endgroup$ Commented Jun 24, 2021 at 11:20
  • $\begingroup$ all those 25 rows belong to one user - you have to somehow inform the model that these 25 rows belong to the user_id i. this is called 'clustered/grouped data' and in statistics it refers to 'repeated measurement'. if you have 100K users each with dozens of entries, it would be a real challenge to fed the data into a classifier e.g. xgboost to do a classification. now scale it up :) $\endgroup$
    – user702846
    Commented Jun 25, 2021 at 9:29

You should try both approaches, see what works best for your business objective and possibly serve up a hybrid recommendation using outputs from both models.

You should also look at models that take advantage of user or item similarity information to suggest products to users.

One disadvantage of the matrix factorization technique is that they suffer from the cold start problem in not being able to serve a recommendation for new users that have bought nothing. That is where an approach of using user demographics such as age, gender etc to serve up recommendations based on what similar users have purchased in the past helps.

Also, no matter what technique you choose, make sure to retrain the models periodically giving higher weightage to recent activity of your user base to keep track of latest usage trends.

  • $\begingroup$ My issue is, precisely, that I cannot find any advantage of the matrix factorisation approach in this case. Can you think of any? $\endgroup$ Commented Jun 20, 2021 at 9:52
  • 1
    $\begingroup$ I guess the matrix factorization approach is the best thing one can do in absence of customer demographics. That is the only advantage I can think of. $\endgroup$ Commented Jun 20, 2021 at 16:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.