The Mahout In Action (Chapter 6) book contains a recommendation method based on matrix multiplication that uses co-occurrence data (C) in combination with user preferences (U) to generate user recommendations (R).

Here's a small example to illustrate it. Say the co-occurrence matrix for 4 items is

 C = [5 3 4 4
      2 1 0 3
      2 2 1 6
      1 4 1 5]

and the user preference vector is

 U = [2 3 0 0]

Here, we know the user's relative level of interest in the first two items and we are trying to gauge which one of the other two items can be used as a recommendation.

To find this, we first fill in 0s for those items and then perform a simple matrix multiplication and compute R = C * U

 R = [19

With this information, we ignore the first two terms (because we already know the level of the user's interest in them) and conclude that item #4 is a better recommendation compared to item #3.

Question: Is there a "formal" name for this method or is this just a variant of collaborative filtering? Is there a mathematical basis (and/or intuition) for why such a method should work?

Compared to other recommendation methods (such as matrix factorization for instance), this approach is very simple because it only requires simple matrix multiplication. I'm wondering if there has been a study to compare such a simple method to the more complex ones.

  • $\begingroup$ I prepared an answer for you, but before posting realized that you mentioned the matrix factorization, so you're aware of it, at least to some degree. Please let me know, if you'd be interested in me still posting my answer, which contains some resources on MF and NNMF. $\endgroup$ – Aleksandr Blekh Dec 9 '14 at 11:46
  • $\begingroup$ Yes, please, I'd like to see the list of items for MF and NNMF. $\endgroup$ – user2602740 Dec 9 '14 at 16:23

Considering your request as well as the fact that your question fits the context of recommender systems, I think that you may benefit from reviewing some information on matrix factorization techniques (including NNMF - non-negative matrix factorization) for producing recommendations. I hope that the following resources will be useful for you in this regard as a starting point:

Speaking of tools, specifically focused on Non-Negative Matrix Factorization (NMF) or supporting this technique, the following resources might be of your interest:

  • 1
    $\begingroup$ Thank you very much for listing all these resources. These are very helpful. $\endgroup$ – user2602740 Dec 10 '14 at 7:34
  • $\begingroup$ @user2602740: You're very welcome. Please consider upvoting. $\endgroup$ – Aleksandr Blekh Dec 10 '14 at 7:45

As the book mentions, this is a form of item similarity based recommendation. When we compute the rating estimation for an item i, we take into account the ratings the user has given for items similar to i, where simliarity is defined in terms of co-occurrence. There is some further explanation in the book (section 6.2.4) about the intuition behind this.

As noted in the book, an apparent disadavantage of this method that it only yields a preference order of items, without any meaningful scalar scores. My impression is that on real data even with a moderate number of items, this method runs into data sparsity problems: most of the users will have rated only a few items, and the co-occurrence matrix might be sparse, so there will be too few non-zero elements in the rating estimation vector we compute.

I fully agree, this method is by far simpler than matrix factorization or any other approach in actual use. I think in the book it serves the purpose of what we may call a "toy example".

I find it very well possible that on a set of a few hundred items and lots of ratings this method performs reasonably, just as any other simple heuristics would (although unrelated items might co-occur a lot in such a scenario). More complicated recommender approaches are designed to operate on a much larger scale, as applications with a few hundred items do not necessarily benefit from having a recommender system (users can explore all the interesting items relatively easily).

Recommending only the n most popular items sort of works, but methods having access to all the items generally outperform these restricted versions (a little bit depending on the domain -- for instance, in news recommendation popularity matters a lot). There has been a lot of research around the comparison of different recommender algorithms, but I'm not aware of any article using this particular one.

  • $\begingroup$ You make a fair point with regards to the preference order instead of a scalar score. However, my particular use case has number of items as a fairly small number (say 100-1000). In such a scenario, don't you think that this type of matrix multiplication is much simpler to understand/implement/explain? Also, even if the item count is large, I'm thinking that we can always reduce it to a "candidate" set of say 500 (perhaps by picking the top-500 items by absolute count) and proceed from there. $\endgroup$ – user2602740 Dec 9 '14 at 16:28
  • $\begingroup$ I edited my answer to address some of your points (won't fit in a comment). I wonder what your usecase is? $\endgroup$ – sandris Dec 10 '14 at 10:20
  • $\begingroup$ Thanks for the edit. My items have a sort of hierarchy of stores and products. The number of products is obviously a huge number but the number of stores is not really very big - it's around 10K of which only the top 1K are the ones that are important from a profit perspective. As a result, if I'm doing store-specific recommendations, then the candidate set to choose from is not very big. $\endgroup$ – user2602740 Dec 10 '14 at 16:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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