RecDB

From RecSysWiki
Revision as of 21:02, 12 December 2013 by MoSarwat (talk | contribs)
Jump to navigation Jump to search

RecDB is an open Source Recommendation Engine built entirely Inside PostgreSQL 9.2. RecDB allows application developers to build recommendation applications in a heartbeat through a wide variety of built-in recommendation algorithms like user-user collaborative filtering, item-item collaborative filtering, Singular_value_decomposition. Applications powered by RecDB can produce online and flexible personalized recommendations to end-users. RecDB has the following main features:

  • Usability: RecDB is an out-of-the-box tool for web and mobile developers to implement a myriad of recommendation applications. The system is easily used and configured so that a novice developer can define a variety of recommenders that fits the application needs in few lines of SQL.
  • Seamless Database Integration: Crafted inside PostgreSQL database engine, RecDB is able to seamlessly integrate the recommendation functionality with traditional database operations, i.e., SELECT, PROJECT, JOIN, in the query pipeline to execute ad-hoc recommendation queries.
  • Scalability and Performance: The system optimizes incoming recommendation queries (written in SQL) and hence provides near real-time personalized recommendation to a high number of end-users who expressed their opinions over a large pool of items.

How It Works

Creating a Recommender: Users may create recommenders a-priori so that when a recommendation query is issued may be answered with less latency. The user needs to specify the ratings table in the ON clause and also specify where the user, item, and rating value columns are in that table. Moreover, the user has to designate the recommendation algorithm to be used to predict item ratings in the USING clause. An example of creating an Item-Item Collaborative Filtering recommender on the User/Item ratings table MovieRatings is as follows


CREATE RECOMMENDER MovieRec ON MovieRatings

USERS FROM userid

ITEMS FROM itemid

EVENTS FROM ratingval

USING ItemCosCF


Generating Recommendation: To generate recommendation, RecDB allows users to write their recommendation query using SQL. In the recommendation query, the user needs to specify the ratings table and also specify where the user, item, and rating value columns are in that table. Moreover, the user has to designate the recommendation algorithm to be used to predict item ratings. For example, if MovieRatings(userid,itemid,ratingval) represents the ratings table in a movie recommendation application, then to recommend top-10 movies based on the rating predicted using Item-Item Collaborative filtering (applying cosine similarity measure) algorithm to user 1, the user writes the following SQL:


SELECT * FROM MovieRatings R

RECOMMEND R.itemid TO R.userid ON R.ratingval USING ItemCosCF

WHERE R.userid = 1

ORDER BY R.ratingval

LIMIT 10


The main benefit of implementing the recommendation functionality inside a database engine (PostgreSQL) is to allow for integration with traditional database operations, e.g., selection, projection, join. For example, the following query recommends the top 10 Comedy movies to user 1. In order to do that, the query joins the recommendation with the Movies table and apply a filter on the movies genre column (genre LIKE '%Comedy%').


SELECT * FROM MovieRatings R, Movies M

RECOMMEND R.itemid TO R.userid ON R.ratingval

USING ItemCosCF

WHERE R.userid = 1 AND M.movieid = R.itemid AND M.genre LIKE '%Comedy%'

ORDER BY R.ratingval

LIMIT 10


External Links