So I am building a recommendation model using customer and product information. This will be done via implicit, that is, a customer has a product or not as we don't have rating information about products. I want the model to recommend a product using collaborative filtering so I am thinking of using a recommender model like Matrix factorisation/ SVD etc. I will perform multiple tests/experiments to determine the best algorithm to go with.

Should I perform clustering first to determine similar customers based on their demographic and geographic information before the recommender? Then subsequently should I train a recommender model for each cluster?

Would there be any benefit in this approach or would the recommender model be able to naturally determine similar customers?


3 Answers 3


Short Answer: No, you should not perform clustering before doing matrix factorisation.

First, I just want to say SVD is a special case of Matrix Factorisation. Another thing, SVD in recommendations is not traditional SVD, but has a different form.

Detailed Answer for why (in general) you should not perform clustering before doing matrix factorisation

Matrix Factorisation (MF) itself performs clustering. When you perform Matrix Factorisation, you end up with latent vectors for user and items. By running a clustering algorithm, such as K-Means, on these latent vectors, you end up doing clustering. But, if your end goal is just to recommend, then, there is no point performing clustering apriori.

In some corner cases, you may consider performing clustering

  • Do you want to cluster to understand the data better and build different recommendation models for every different cluster? If yes, then you may consider doing clustering before hand.

You should consider it:

  • Using a collaborative filtering model will implicitly learn the users similarity. If you extract the lower dimension representation of users this will give you what can be considered as user embeddings. If you perform clustering on this you can get user clusters. The issue is that unless you perform collaborative filtering with side information, these clusters will only take into account the user feedback. If you choose to use a model with side information you will see that it's harder to train.

  • So using collaborative filtering + cluster of users can help you augment your recommender model: i.e on top of the recommendation returned, you can also add the most popular products for a given cluster of users this may help mitigate the recommendations of new users with popular items.

  • the only hard no here is do not train multiple recommender models. This will make your life harder (each model will learn from less data). Tastes are ambiguous and a single model can learn nuances between customer groups.


This is where your domain expertise comes into play. Some of the important considerations, e.g. location-based user behaviors and location-based offering of products.

For a typical recommendation problem, all you need is the product ratings from the users. The product characteristics and users' behavior towards them are inferred.

What you additionally have is a set of attributes that can help you create categories of individuals with similar behavior. Providing these as a part of your rating matrix will just confuse a typical recommendation algorithm. The question that arises now is how to best use them, as more data is always better to have. This can be achieved through prior clustering.

The main takeaway is that these are two separate parts of the bigger problem you are trying to solve. You would have to evaluate which approach is more efficient while keeping in mind that you shouldn't end up with a huge number of clusters that would significantly reduce product rating data for each of them.

Alternatively, if you have less number of products, you can go for a multi-label or multi-output classification formulation of your problem, as you are looking for a binary outcome of recommending a product or not (not a rating).


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.