Nowadays a lot of websites try to guess what we could like: ”Recommendation for you in books” or ”People you may like”. Sounds familiar, isn’t it? Wouldn’t be cool if you could do the same in your application? Well, this session is for you! In the first part of this talk, recommendation systems will be introduced, focusing on collaborative filtering algorithms (CR). After that we’ll dive in Prediction.io, an open source machine learning server for software developers to create predictive features, such as personalization, recommendation, and content discovery.
17. User rate items
We build a model of user preference
Look for similar items based on the model
18. Action 0.7
Sci Fi 3.2
Vin Diesel 1.2
… …
Title Star Trek
Genre Sci Fi
Actors
William Shatner
LeonardNimoy
User Model
Title XXX
Genre Action
Actors
Vin Diesel
Asia Argento
Title Kick Ass
Genre Action
Actors
Nicholas Cage
Mark Strong
20. 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
30. 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?
31. Only consider items both users have rated
For each item
- Compute 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
34. 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.
36. 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
44. Pattern: user -- action -- item
User 1 purchased product X
User 2 viewed product Y
User 1 added product Z in the cart
45. $ 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
46. Server runs on port 7070 by default
$ curl -i -X GET http://localhost:7070
{“status":"alive"}
47. $ curl -i -X GET “http://localhost:
7070/events.json?
accessKey=$ACCESS_KEY"