homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderator: open

Databases Forum

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

10+ Year Member

Msg#: 594 posted 11:52 pm on Jun 26, 2006 (gmt 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?



WebmasterWorld Senior Member 10+ Year Member

Msg#: 594 posted 11:58 pm on Jun 27, 2006 (gmt 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.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved