This document provides an overview of building a recommendation engine for an online book shop using PredictionIO. It discusses recommendation systems and different types of algorithms like content-based filtering, collaborative filtering using user-user and item-item similarities, and model-based approaches. It also covers installing and using PredictionIO, modeling event data, building recommendation engines, and implementing the engine to provide book and ebook recommendations to users based on actions like views, likes and purchases.
2. 1) Intro to recommender systems
2) PredictionIO
3) Case Study
3. Definition: a system that help people
finding things when the process of
finding what you need is challenging
because you have a lot of choices/
alternatives
30. Need to know items content
User cold start: time to learn important
features for the user
What if user interest change?
Lack of serendipity: accidentally
discover something you like
47. Item1 Item2 Item3 Item4 Item5
Joe 8 1 ? 2 7
Tom 2 ? 5 7 5
Alice 5 4 7 4 7
Bob 7 1 7 3 8
How similar are Joe and Tom?
How similar are Joe and Bob?
48. Only consider items both users have rated
For each item
- Calculate difference in the users’ ratings
- Take the average of this difference over the items
Item1 Item2 Item3 Item4 Item5
Joe 8 1 ? 2 7
Tom 2 ? 5 7 5
Alice 5 4 7 4 7
Bob 7 1 7 3 8
51. Recommend what similar user have
rated highly
To calculate rating of an item to
recommend, give weight to each user’s
recommendations based on how similar
they are to you.
52. use entire matrix or
use a K-nn algorithm: people who
historically have the same tastes as me
aggregate using weighted sum
weights depends on similarity
53. Item1 Item2 Item3 Item4 Item5
Joe 8 1 ? 2 7
Tom 2 ? 5 7 5
Alice 5 4 7 4 7
Bob 7 1 7 3 8
How similar are Item1 and Item2?
How similar are Item1 and Item3?
54. Only consider items both users have rated
For each item
- Calculate difference in ratings for the 2 items
- Take the average of this difference over the users
Item1 Item2 Item3 Item4 Item5
Joe 8 1 ? 2 7
Tom 2 ? 5 7 5
Alice 5 4 7 4 7
Bob 7 1 7 3 8
69. Pattern: user -- action -- item
User 1 purchased product X
User 2 viewed product Y
User 1 added product Z in the cart
70. $ pio app new MyApp1
[INFO] [App$] Initialized Event Store for this app ID: 1.
[INFO] [App$] Created new app:
[INFO] [App$] Name: MyApp1
[INFO] [App$] ID: 1
[INFO] [App$] Access Key:
3mZWDzci2D5YsqAnqNnXH9SB6Rg3dsTBs8iHkK6X2i54IQsIZI1eEeQQyMfs7b3F
$ pio eventserver
71. Server runs on port 7070 by default
$ curl -i -X GET http://localhost:7070
{“status":"alive"}
72. $ curl -i -X GET “http://localhost:7070/
events.json?accessKey=$ACCESS_KEY"