nanxstats / blog-comments

utterances comments
0 stars 1 forks source link

blog/post/triplet-loss-r-keras/ #3

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

Implementing Triplet Losses for Implicit Feedback Recommender Systems with R and Keras - Nan Xiao | 肖楠

https://nanx.me/blog/post/triplet-loss-r-keras/

nanxstats commented 3 years ago

Comment written by Xavier FOLCH on 2018-09-13 06:03:23

Thank you for this blog. I am developing in Python and I am new with Keras. I implemented BPR by hand directly from the publication but I was looking for a way to use neural network with it. Your code and explanation were really helpful.

nanxstats commented 3 years ago

Comment written by Nan Xiao on 2018-09-13 13:58:40

You're very welcome!

nanxstats commented 3 years ago

Comment written by Xavier FOLCH on 2018-09-13 14:03:51

Here my github, it might interest you (nothing fancy, I am just starting in data science): https://github.com/xavierfeltin/mtg_data_mining

nanxstats commented 3 years ago

Comment written by Sebastian Gonzalez Aseretto on 2018-11-26 14:40:47

Hello @nanxstats I've read your previous blog post and this one, and they are very interesting. But since I'm a little bit new on implementing collaborative filtering with neural networks, I'm having the following problem. In the case of MovieLens you generate your "negative samples" on items that had been ranked below 3 or had not been rated by the user. How can you apply this method (Triplet Loss and BPR Triplet Loss) to create a model over a dataset like last.fm or audioscrobbler. Those datasets doesn't contain ratings, but the number of times a user reproduced an artist. The problem I see with those two datasets is that a user could have reproduced an artist 0, 1, 20, or 100 times. How would you model your architecture (input layer and embeddings) in order to train the recommendation system?

nanxstats commented 3 years ago

Comment written by Nan Xiao on 2018-11-26 19:56:51

Thanks for the comment! In principle, I guess there might be better ways to model that data but I don't think it will affect the model architecture here if you want to use this approach. The only difference is how you construct the triplets. For example, in the lastfm dataset, let's assume each user is an anchor. You can probably sample from the heavily listened artists above a threshold as the positive samples for each anchor, and sample from the much less listened or unlistened artists below a threshold as the negative samples for each anchor, thus the triplets.

That's the beauty of this method. Even though there is not explicit feedbacks, as long as you have a subtle way to make relative comparisons for user responses to items, you can model it.

nanxstats commented 3 years ago

Comment written by Sebastian Gonzalez Aseretto on 2018-11-28 12:59:48

Thanks for the answer, I was thinking on using a variation of the sigmoid function as my threshold, so that high interactions will tend to one, and lower ones to 0, I'will test them and see if it works.