Recommendation systems use informational filtering techniques to make assumptions about preferences. One of the most successful recommendation approaches is called collaborative filtering. This method uses the known preferences of a group of users to make predictions on the unknown preferences of other users. Amazon uses this approach with item-to-item collaborative filtering.
Taking a single product, the Amazon system build a neighbourhood of related items. Every time you buy, or even view, an item, you get served recommended items based on the original product. Amazon stores each user’s data as a very long string in an incredibly large table. The row that represents you reflects everything you have ever looked at, clicked on and purchased, and is updated every time you visit the site. This data is then used to determine what you see on each page you visit and each marketing email you receive.
On a far smaller scale, this tutorial from PredictionIO guides followers through building a Tinder-style, comic recommendation web app called Tapster. This app displays a comic strip to the user who can either Like or Dislike it. The app leverages the collected data to recommend comics that match the user’s preferences. This demo app uses Similar Product Template for recommendations based on immediate user activities, and the collaborative filtering recommendation algorithm MLLiB ALS (Alternating Least Squares).
The demo application is built using Rails with default settings provided for PostgreSQL, MySQL and SQLite. After installing PredictionIO, set up the project and modify the engine template so it is ready to import the data. The engine then requires some minor training and then the model is ready to deploy, with a connection to PredictionIO to log live interaction events and query the server for recommendations.
This demo could be adapted to recommend anything you have the data for, but links to the sample data here are provided. Sample code is also provided, with links to the source code on GitHub.