0
$\begingroup$

I have a data set which contains about 400,000 unique items present on a platform. The users on this platform can like and save this in their own list. Now, I have about 4000 users with their like data which looks like this

| UserID | ItemID | 
|  1     |   3    |
|  1     |   4    |
|  1     |   10   |
|  1     |   13   |
|  2     |   3    |
|  2     |   40   |
|  3     |   1    |
|  3     |   23   |

An item will only be present against the user-item pair only when the user likes an item. I am trying to recommend items to other users/users to other users using User-User/User-Item Collaborative filtering but I couldn't find any leads on how to achieve that using python. Any help on this would really be appreciated!

$\endgroup$
4
  • 1
    $\begingroup$ You can checkout library like Lightfm with BPR (bayesian personalized rating) criteria making.lyst.com/lightfm/docs/lightfm.html $\endgroup$ – hssay Jul 20 '20 at 12:05
  • $\begingroup$ @hssay Correct me if I'm wrong but LightFM library uses ratings to compute recommendations, right? $\endgroup$ – Dhaval Thakkar Jul 20 '20 at 12:07
  • 1
    $\begingroup$ Afaik, LightFM supports implicit feedback models (where no explicit ratings available) based on arxiv.org/pdf/1205.2618.pdf this paper. So it will be worth trying by using 1/0 weights and BPR as a criteria. The example is covered in making.lyst.com/lightfm/docs/examples/movielens_implicit.html where they treat rating as implicit $\endgroup$ – hssay Jul 20 '20 at 12:12
  • $\begingroup$ In the example that you shared above, I'm unable to see how they made the CSR matrix. So for a dataset that I showed in the question above, how do I go about creating the train and test datasets? $\endgroup$ – Dhaval Thakkar Jul 20 '20 at 12:24

Your Answer

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

Browse other questions tagged or ask your own question.