recommendable icon indicating copy to clipboard operation
recommendable copied to clipboard

Support for item-based similarity

Open blackgold9 opened this issue 12 years ago • 14 comments

We have similar raters in the gem right now, but i would love to query similar recommendable items(Users who liked x also liked y)?

blackgold9 avatar Mar 19 '12 22:03 blackgold9

current_user.common_likes_with(friend)
#=> [#<Movie title: '2001: A Space Odyssey', year: 1968>]

Similarly, you can do common_dislikes_with

davidcelis avatar Mar 19 '12 22:03 davidcelis

Oops, I jumped to conclusions and misread this. However, liked_by on the recommended item is a public method and returns an array of instances of your User model that liked it.

item.liked_by
#=> [user1, user3, user42, user89, …]

disliked_by is similarly defined

davidcelis avatar Mar 19 '12 22:03 davidcelis

Sorry, I just now completely wrapped my head around what you were asking, and this is a good feature request. I can take a stab at this later, though I'd prefer to fix the issues that you and the other two are having first. I can look at it soon, or you could always take a stab at it as well and submit a pull request.

davidcelis avatar Mar 19 '12 22:03 davidcelis

No pressure :) Just wanted to put it on the docket.

blackgold9 avatar Mar 19 '12 22:03 blackgold9

This would actually be, from what I can tell and as I think about it more, super easy to do and would be useful to boot. Thanks for suggesting!

davidcelis avatar Mar 19 '12 22:03 davidcelis

So I've been thinking about this for a while now, and I'm not sure that this is something I really want to include in the framework. Having recommendable handle both user-based and item-based similarities will really increase the memory footprint of Redis. I could perhaps implement it in a way where the user chooses one or the other (or if they really want to, both), but they'll have to be explicitly chosen. This may be a simpler task after I implement the callbacks feature that another user suggested. Until then, I'm putting this on the backlog.

davidcelis avatar Apr 18 '12 16:04 davidcelis

Hi @davidcelis, how is this going?

jinzhu avatar Jun 16 '12 14:06 jinzhu

@jinzhu See my previous comment

davidcelis avatar Jul 06 '12 16:07 davidcelis

I would love to see this. In the meantime, I may have to run this and recommendify in tandem to get both :)

aaronchi avatar Feb 18 '13 15:02 aaronchi

Would it be possible do to this by having the recommended model recommend itself? So, for example, when a user likes a product, you write a callback that has that product like the other products the user has liked. Then, would the product.recommended_products be the same relationship (or maybe product.similar_products)?

bencrouse avatar Sep 20 '13 02:09 bencrouse

i think what i'd rather do is, with version 3, implement a per-recommendable configuration. i.e. you can pass options to recommends :things, one of which would allow it to be an item-based similarity as opposed to user-based. version 3 has a lot of good stuff in the works, but i don't have a ton of time to work on it.

davidcelis avatar Sep 20 '13 03:09 davidcelis

+1 item-based recommendations

holgerw avatar Oct 16 '13 14:10 holgerw

+1

Recommendify does item-based recommendations and we were getting great results from it, but were scared off from using it in production since the project is not really maintained anymore. I'd love to see that feature in this gem.

ddgromit avatar Apr 09 '14 00:04 ddgromit

@ddgromit I was in the same boat, and ended up going with https://github.com/Pathgather/predictor

bencrouse avatar Apr 09 '14 00:04 bencrouse