Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Suggestion Query

If a User likes x, then they may also like y (based on other users' history

11:52 pm on Jun 26, 2006 (gmt 0)

Full Member

10+ Year Member

joined:Feb 4, 2005
votes: 0

How would one tackle this product suggestion query?

Here is the setup. Users can rate products on a 1-10 scale. If a user says he likes product x, I would like to lookup all of the other users who liked x (based on if they rated x above say 9/10). Then look at all of those users'(the ones who rated x 9+) ratings to pick out the some other highly rated products that all people who like x have in common.

The part that is beyond me is how I would approach the issue of seeing what multiple users like in common.

Does this make sense at all?

11:58 pm on June 27, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 27, 2001
votes: 0

I don't know about a query but an algo might be something like:
Customer likes items A_i

For each A_i find all customers who also like A_i, store in array C

Loop through array C and find all other things those customers liked, store in hash L (item sku is key, how many of them liked each thing is value)

Return the hash L sorted by the number of people who liked each thing.

If you have a lot of customers and products this will take time so you might do it nightly and store the results for each customer in a seperate table.