Upgrade to Pro — share decks privately, control downloads, hide ads and more …

People who liked this talk also liked … Buildin...

Ryan Weald
February 23, 2013

People who liked this talk also liked … Building Recommendation Systems Using Ruby

From Amazon, to Spotify, to thermostats, recommendation systems are everywhere. The ability to provide recommendations for your users is becoming a crucial feature for modern applications. In this talk I'll show you how you can use Ruby to build recommendation systems for your users. You don't need a PhD to build a simple recommendation engine -- all you need is Ruby. Together we'll dive into the dark arts of machine learning and you'll discover that writing a basic recommendation engine is not as hard as you might have imagined. Using Ruby I'll teach you some of the common algorithms used in recommender systems, such as: Collaborative Filtering, K-Nearest Neighbor, and Pearson Correlation Coefficient. At the end of the talk you should be on your way to writing your own basic recommendation system in Ruby.

Ryan Weald

February 23, 2013
Tweet

More Decks by Ryan Weald

Other Decks in Programming

Transcript

  1. People who liked this talk also liked … Building Recommendation

    Systems Using Ruby Ryan Weald, @rweald LA RubyConf 2013 1
  2. 4

  3. Outline 1) What is a recommendation system? 2) Collaborative filtering

    based recommendations 3) Content based recommendations 4) Hybrid systems - the best of both worlds 5) Evaluating your recommendation system 6) Resources & existing libraries 5
  4. What this Talk is Not • Everything there is to

    know about recommendation systems. • Bleeding edge machine learning • How to use a specific library 6
  5. A program that predicts a user’s preferences using information about

    the user, other users, and the items in your system. 8
  6. 1. Memory Based - Uses similarity between users or items.

    Dataset usually kept in memory 2. Model Based - Model generated to “explain” observed ratings Two Types of CF 16
  7. Video 1 Video 2 Video 3 Video 4 Video 5

    User 1 User 2 User 3 User 4 User 5 0 1 0 5 0 1 2 1 0 5 2 5 0 0 2 5 4 4 1 1 2 4 ? ? 2 Collaborative Filtering * 0 denotes not rated 18
  8. 27

  9. Video 1 Video 2 Video 3 Video 4 Video 5

    User 1 User 2 User 3 User 4 User 5 0 1 0 5 0 1 2 1 0 5 2 5 0 0 2 5 4 4 1 1 2 4 ? ? 2 Collaborative Filtering * 0 denotes not rated 29
  10. 30

  11. Content Based Recommendations Classify items based on features of the

    item. Pick other items from same class to recommend. 33
  12. Content Based Algorithms • K-means clustering • Random Forrest •

    Support Vector Machines • ... • Insert your favorite ML algorithm 34
  13. Content Based Algorithms Type of content Duration Maturity Rating Video

    1 Video 2 Video 3 Video 4 Video 5 comedy 60 G action 120 G comedy 34 PG-13 romantic 15 R sports 120 G 35
  14. K-means Clustering Group items into K clusters. Assign new item

    to a cluster and pick items from that cluster 36
  15. • Unsupervised Learning is hard • Training data limited or

    expensive • Doesn’t take user into account • Limited by features of content Problems With Content Based Recommendations 38
  16. Evaluating Recommendation Quality • Precision vs. Recall • Clicks •

    Click through rate • Direct user feedback 44
  17. Summary of What We’ve Learned • Collaborative Filtering using similar

    users • Content clustering using k-means • Combining 2 algorithms to boost quality • How to evaluate your recommender 47
  18. Don’t Reinvent the Wheel • Apache Mahout • JRuby mahout

    gem • SciRuby • Recommenderlab for R 48
  19. Resources & Further Reading • Recommender Systems: An Introduction •

    Linden, Greg, Brent Smith, and Jeremy York. "Amazon. com recommendations: Item-to-item collaborative filtering." • Resnick, Paul, et al. "GroupLens: an open architecture for collaborative filtering of netnews." • ACM RecSys Conference Proceedings 49