How to create a recommendation algorithm ("If you like X and Y, you might like Z")?

I want to create an algorithm which recommends "You might also like" items from an itemlist, based on user's current liked itemlist (favorites) and based on those created by other users with similar preferences (in JS/MySQL, but that should not be of importance).

The input is simply a set of all items, and subsets (list of favorites) created by users.

Update: @Robert Harvy's Music example is a good one for clarification. Itemset: 100 bands. John likes bands 1,2,3,4,5, 11,12. Jane likes 1,2,3,4,5, 10,12. Their music tastes are likely to be similar, just as their fav lists are. The algorithm should notice this and recommend band 10 to John and 11 to Jane. No characteristics would need to be concidered in this simple scenario.

closed as too broad by gnat, Doc Brown, Thomas Owens Apr 10 at 15:11

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Simple: your run Amazon and gather statistical data from their visitor logs. ;-) – Doc Brown Apr 10 at 14:56
  • @Doc Brown I don't think visitor logs have has anything to do with my question. I need to create a "you might like" lists as subsets of an itemlist based on current favourites lists. – Marko36 Apr 10 at 15:01
  • Is this a request for code? Coding questions are off-topic here. – Robert Harvey Apr 10 at 15:06
  • Not really, an approach or possibly an existing solution is what I'm after. If I wanted code, I'd go Stack Overflow, but the question as such is "too broad" for SO. – Marko36 Apr 10 at 15:14
  • I don't see what is too broad about this question. It has a pretty straightforward (basic) answer: find all the other people who like X and Z, build a histogram of their favorites and suggest one or more with the highest frequency. – JimmyJames Apr 10 at 15:26

You find similarities between objects by identifying characteristics of those objects and then see which characteristics two or more objects have in common. Or, you simply watch the behavior of online customers and compare what they buy with other things they also buy.

For example, if you Google "Bands Like Steely Dan," Google will respond with the Doobie Brothers, Steve Winwood, the Allman Brothers Band, Eagles, Fleetwood Mac, Jackson Browne, Talking Heads, Eric Clapton, Crosby Stills and Nash, Hall and Oates, James Taylor, Neil Young, Simon & Garfunkel, etc.

Now, it could be credibly argued that these bands don't really resemble Steely Dan's musical style all that much. What they do have in common is that they all come from the same era, and they are all in the "classic rock" genre. And yes, folks who like Steely Dan also tend to like these other bands.

That's how you make a recommendation engine. You find things to recommend that have characteristics in common with the thing that the user searched or bought.

Not the answer you're looking for? Browse other questions tagged or ask your own question.