BRIDGEi2i Whitepaper - Recommender Systems: The Genie for your business

12
Recommender Systems The Genie for your business! White Paper

Transcript of BRIDGEi2i Whitepaper - Recommender Systems: The Genie for your business

Recommender Systems

The Genie for your business!

White Paper

Netflix was founded in 1997 when Reed Hastings was forced to pay $40 in overdue fines after returning Apollo 13 6 weeks past its due date.

Starting with a meagre 925 titles for rent, Netflix now boasts a collection of 100,000 titles and over 44 million subscribers. While a monthly subscription model for unlimited rentals without any late fees has served Netflix well, it would be for nought without a core technology that ensures that a Netflix customer enjoys the best movies and gets the most bang for his buck every time he streams a movie online or rents a DVD by mail, week after week, month after month.

Enter Cinematch, an extensive personalized video-recommendation system based on ratings and reviews by Netflix customers. The logic is simple - if you had a movie-geek buddy who knew

Recommender SystemsThe Genie for your business!

your tastes and picked the right movie to go with your pizza and beer/coke float with uncanny precision, you'd keep him around wouldn't you? With Netflix, every customer would now renew his monthly subscription for not just a movie rental service but for his very own personal movie-geek buddy.

In fact, so critical was the core recommendation engine to Netf l ix ' s growth and future dominance in the video rental and streaming market that in 2006, it held the Netflix Prize ( ), a contest thrown open to www.netflixprize.comthe public to improve the accuracy of its recommendations. The competition lasted nearly 3 years and in September 2012, Netflix awarded the 1 Million USD prize to the BellKor's Pragmatic Chaos team for an algorithm that bet the Cinematch base score by 10.06%.

So what exactly is a recommendation engine and how does it work? Recommender system are software which recommend item which may be news, cloths, books, videos (movies), songs, household items and electronic products etc.

Recommender Systems in Ecommerce platform - Example

Let us take an example of an e-commerce website. Depending on the surfer click pattern, search criteria and historical data related to user, recommender system recommend product for the user. Suppose you want to buy a book from some e-commerce website selling book ( for example: flipkart.com). So, you open their site and search the book that you want to buy. The website will display the search results will have the book you desired. Website will also display few more book as recommended books, under a section named “Customers Who Bought This Book Also Bought” somewhere in the webpage. The website is recommending those books to you. Suppose you close the website and open the same website again then it will again suggest books related to you earlier search results (if web cookie are enabled in your web browser) under a section named “You may like”.

Recommender system can personalise the shopping website to users, where each user will have different recommendations depending on their preferences.

Other type of recommender system can be generalized, where the website will display item like bestselling book or newly released books.

2

When do we need a Recommender System?

A good recommender system can give business advantage over its competitor. Following is an example of its capabilities (Ecommerce Example extended)

Suggest item which the user wants to buy, but the user is not able to search it on the e-commerce website Suggest items which are complementary to an item the user is buying Suggest item which are supplementary to an item users is buying Suggest item which are new in the market and the user might not know about that product Motivate the user to buy more things then they planned for. Increased cross selling. Will increase the chance of customers re-visiting the website if customer over all user experience is good.

Benefits of recommender system

These systems base their suggestion on user actual behaviour and not just guess work. These systems are personalized to users taste. It learns users liking and taste by monitoring its browsing

pattern and all this happens real time. It recommends based on past history, so one can say it is like a good friend who knows the user very well, who knows the user likes.

These systems are always up to date. Recommender system will recommend newly launched item to its user if those items match with user's taste. Recommender system updates user behaviour also.

Drawbacks of recommender system

New users may not get good recommendation from the system because of lack of information of user's likes.

New items may not be recommended to users may be due to lack of item information.So, a good recommender system leads to increase in the revenue generated for a company and better customer satisfaction.

Algorithms used in recommender system

Behind every recommender system there are algorithms which recommends item to user which is in line with users taste. Recommender systems includes predictive model, data collection and user interaction etc. These systems are a kind of search engine customized as per user preferences. Systems keep historical data of users, users rating, items and sales history of items. These data are used by different algorithms to suggest item to user. Collaborative Recommendation System: This system uses user-item rating to recommend items to user.

These systems don't use item's property or information. Content Based Recommendation System: This system uses item's property, features and character to

recommend items. Knowledge Based Recommendation System: This system relies on detail specification of the item, and

uses constraints based approach to narrow down the search to suggest item. Suppose a person want to buy a cell phone than user can specify the requirements like resolution of camera, 3G or 4G etc. So the search is constrained.

Hybrid Recommendation System: This system consists of more than one type of recommender system. So input is feed to 'n' different recommender and using some mechanism output from these 'n' recommender systems is used to recommend items to a user.

3

Collaborative Recommendation System: We are going to discuss two algorithms.

User to User nearest neighbour algorithm: Suppose we have user-item rating as demonstrated below.

The above table contains rating of different movies by different users on a scale of 1 (lowest) to 10 (highest). For e.g. Alice rated Movie1 as 9 i.e. she liked the movie very much whereas Eva did not like this movie so she rated it 4. Alice has not seen Movie5, so it is still not rated by her. We need to ascertain whether Alice will like this movie or not. If we are able to predict her rating for this movie then we can recommend this movie to her if predicted rating is high.

In this algorithm we will find user similar to Alice and use their rating on Movie5 to predict rating for Alice. We use Pearson correlation coefficient to find similarity between two users. The below table show the correlation between Alice and rest of the users.

Alice

Bob

Carol

Dave

Peter

Movie1 Movie2 Movie3 Movie4 Movie5

9

6

6

5

4

7 6 7 X

3 2 4 6

5 4 7 8

9 8 7 10

9 10 X 4

Correlation

Movie1 Movie2 Movie3 Movie4 Movie5

C(A,B)=0.97

User

So Alice is similar to Bob and Carol in rating movies i.e. Bob and Carol are in neighbourhood of Alice. So we can use Bob's and Carol's rating to predict Alice's Movie5 rating. To predict Movie5 rating we require the average rating across all movies by Carol, Bob, and Alice:

Average of movie ratings by different users.

m(A)=7.25

Bob Carol

m(B)=3.75 m(C)=5.5

Alice

Predicted rating of Movie5 by Alice PR(Movie5,A) = m(A) + [C(A,B)x{Ra(Movie5,B)-m(B)} + C(A,C)x{Ra(Movie5,C)-m(C)}] C(A,B) + C(A,C)

where Ra(Movie5,B) is rating of Movie5 by user Bob.

PR(Movie5,A) = 7.25 + (0.97x(6 - 3.75)+0.51x(8 – 5.5))/(0.97 + 0.51) = 9.6

Since the predicted rating of Movie5 is high, Recommender System can suggest Movie5 to Alice. The same process can be repeated for all movies that Alice has not rated.

4

CoefficientC(A,C)=0.51 C(A,D)=0.51 C(A,D)=-0.81 C(A,P)=-0.98

Use Case 1 User Profiling and Advertisement Recommendation for Video Encyclopedia Company

We engaged with an online video encyclopedia company for user profiling and recommending advertisements of interest to the consumers of the video content. In order to qualify users under different interest groups we had to identify unique users. We did not use browser cookie information owing to legal restrictions around placing cookie at end user's browser without his consent. We also have the risk of losing track of the user once the cookie is removed from the system.

STEP 1: User Identification

We used the hardware configurations of the end user's system for consuming video content as the level 1 filter for user identification.

We then identified different web browsing patterns from each system to identify unique users using the same system for video /content consumption in company's or partner website

STEP 2: User Profiling

We profiled users by combining information from the following sources:

Use the browsing pattern information at company website / partner website. Have a minimum threshold defined for the number of websites visited by a user to guess his demographics

Collect meta data information about the videos consumed by the user with the responses given by (some of the) users for a small questionnaire displayed at the end of the videos watched in the session.(The questionnaire is on user's interest areas)

STEP 3: User Profile Validation

The users profiled by the algorithm are validated against existing user profile information received from some users during registration.

The algorithm is then fine-tuned until the match % crosses the minimum threshold.

We captured the advertisement viewership stats after recommendation with advertisement viewership stats before recommendation to measure success.

5

Item to Item nearest neighbour algorithm:

The same user item rating is used for this algorithm. However, here similarity between items and not similarity between users is used for prediction. Cosine similarity function is used to calculate similarity between two items. Cosine similarity function calculates the cosine of the angle between two vectors. Its value lies between 0 and 1- a value close to 1 means the items are very similar.

A better measure of similarity is adjusted cosine similarity function, which is same as similarity function but calculated using mean-adjusted user-item rating. The below table contains mean adjusted user-item rating for the movie rating data.

Alice

Bob

Carol

Dave

Peter

Movie1 Movie2 Movie3 Movie4 Movie5

1.75

2.25

0.5

-2.25

-3.67

-0.25 -1.25 -0.25 X

-0.75 -1.75 0.25 2.25

-0.5 -1.5 1.5 2.5

1.75 0.75 -0.25 2.75

1.33 2.33 X -3.67

A better measure of similarity is adjusted cosine similarity function, which is same as similarity function but used on mean adjusted user-item rating. The below table is mean adjusted user-item rating.

Similarity (Movie1, Movie5)

The table below shows the similarity function value between Movie5 and rest of the movies, and indicates clearly that Movie1 and Movie4 are similar to Movie5.

Rating of Movie5 by Alice will be

= 7.25 + 0.7 = 7.95 is the predicted Movie5 rating

Similarity

Movie1 Movie2 Movie3 Movie4

S(5,1)=0.49 S(5,2)=-0.22 S(5,2)=-0.74 S(5,4)=0.54

6

= 0.49

Content Based Recommendation System:

In this system contents of the item play an important role in recommendation. Many techniques can be used for recommendation like classification and machine learning technique - here user will have an individual mathematical classification model. When a new item is available with its contents then we can pass the contents to a user specific model whose output is predicted ratings of the item. Suppose we have the following user item rating with item contents.

Alice

Bob

Carol

Dave

Peter

Movie1 Movie2 Movie3 Movie4 Movie5

9

6

6

5

4

7 6 7 X

3 2 4 6

5 4 7 8

9 8 7 10

9 10 X 4

Action

Romance

Movie1 Movie2 Movie3 Movie4 Movie5

10

1

1 8 8 9

10 10 1 1

Content

The table above is has Movie content information. Movies have two (for simplicity) types of content - Action and Romance. For example Movie1, Movie3 and Movie4 are action movies. Movie3 is romantic in addition to being an action flick - maybe it's a romance in the war era. Movie2 is a pure romance. From the above two tables one can easily interpret that Alice like Movie 1, 2 and 4 which are either Action movie or Romance movie but not both, whereas Movie3 is high on Action and Romance which Alice rates low. Eva likes Movie 2 and 3 which are Romantic movies. Since we know the Movie5 is high on Action and low on Romance and Alice like Action movie so it is highly probable that Alice will like Movie5. So we can recommend Movie5.

Use Case 2SKU Recommendation for Retail Outlets

A renowned FMCG client wanted to recommend relevant products to the retail stores such that they can realise more revenue by catering to unmet/unrealised demands. The recommendations had to be at a product level and also include purchase quantity. We were provided with sales data (to the retailers) at a monthly level along with demographic information about the retail store. Here we identified stores of similar size, purchase pattern and purchase frequency. We then grouped similar stores. Under each grouping we made a checklist of SKUs sold at an aggregate level. This checklist was mapped against every store in that group for non-overlapping entries and then new SKUs were recommended with purchase quantity. For existing SKUs the average quantity of purchase made for a particular SKU by that group was taken as the reference value.

7

To check the effectiveness of the recommendation, we validated the output with quantity of products ordered for each SKU by a retailer.

Linear Regression Model in content based recommendation: Here we will build a regression model for Alice in which we also consider the interaction term between movie features (Action and Romance) The below table has movies contents with ratings by Alice:

Predicted Rating (PR) = β + β A + β R + β (A X R) 0 1 2 3

The above is a Regression Model for Alice, where A and R are content values of Action and Romance, and AxR is Action and Romance interaction term. For example, for Movie1 A and R are 10 and 1 respectively.

We need to find the value of β , β , β , and β these betas are parameters such that:0 1 2 3

2 2 2 2(PR – Ra ) + (PR – Ra ) + (PR – Ra ) + (PR – Ra ) is minimized1 1 2 2 3 3 4 4

Where PR is predicted rating of Movie1 from the regression model and Ra is actual rating of Movie1 by 1 1

Alice.

Solving the model will give the following value of:

-1.9048

β 11 β 22 β 33

1.1270 0.9048 -0.1270

β 00

From the above table it is clear that Alice likes movies that are high on Action or Romance but not both.

Movie5 have A and R as 9 and 1 respectively, hence predicted rating of Movie5 will be = -1.9+1.127x9+0.9048x1-0.127x9 = 8.01

Since 8.01 is high rating we can recommend this movie to Alice. In this algorithm we have to build a model for each user i.e. if we have 100 users than we will have to build 100 different models. Instead of linear regression one can also go for other algorithms like Support Vector Machine (SVM), Decision trees, and Multinomial Logistic Regression etc.

TF – IDF based recommendation:

This type of Recommender System is used to recommend books, documents and research papers. TF stands for term frequency whereas IDF stands for Inverse Document frequency. TF – IDF is a numerical statistic that is used as a measure of importance of a word in a document in a corpus (collection of documents). TF measures the relative frequency of word in a document, whereas IDF measure how common the word is in the corpus. For example if a word has a large frequency in a document then TF value is high, if the word is present in many documents then IDF value is low.

8

Suppose we have two document d and d . The keywords in d and d are:1 2 1 2

Term

Murder

Mystery

Love

Document d1 Document d2

Count

100 History 105

59 War 52

3 Motivation 2

Term Count

Books web site have to maintain a system which contain information about books like name of the book, genre of the book, author, type (hardcover or paperback), keywords. Keywords are very important to books; these keywords tell the user what kind of books it is. Say the keyword is machine learning, algorithms than user will understand that the particular document is on machine learning topics which deal with different algorithms. The books website will maintain user profile which will contain information like which books user have liked or purchased in the past. Those books will have genre and keywords. Those keywords will be used to find other books and TF – IDF score will be used to rank the books. Books with high TF –IDF score can be recommended to the user.

Knowledge Based Recommendation System

These systems are used to recommend item which are not bought very often. Say mobile phone once bought will be used by the buyer for around 2 years. Other items can be television, camera and laptops etc. These items have lot of information (contents) associated with them, for example mobile phone have information on price, brand, operating system, screen size, camera pixel, features. User will have his/her own preference for mobile phone say the user require a phone in the range of 10K to 15K price tag which good camera (more than 5 MP) and 3G enabled feature. There will be a section on the e-commerce site with filter option as shown below. There the user can enter the requirements and the web site will filter mobile phone which satisfies the user requirement.

9

Brand

SamsungHTCNokiaSonyLGApple

Operating System WindowsAndroid

Screen Size

3 – 3.5 3.5 – 44 – 4.5>4.5

Camera

2 MP2 – 5 MP5 – 8 MP8 – 12 MP> 12 MP

Features

GMSWifi and BluetoothMusic playerFM radio3GPrimary CameraSecondary CameraHD Recording

There will be a section on the e-commerce site with filter options as shown below. There, the user can enter the requirements and the web site will filter mobile phones which satisfy them.

Price

<= 2000

2001 – 5000

5001 – 10000

10001 – 18000

18001 – 25000

25001 – 35000

>35000

10

Users can also specify requirements such as - if camera pixel is more than 8MP then price can be more than 15K. To solve this kind of if – then user requirement Constraint Programing Algorithm (CPA) is used. CPA is a technique to find items which satisfy all the constraints specified by the user. A Constraint problem solves for a set of constraints, all of which have to be satisfied. In this kind of Recommender System, constraints are set by the requirements of user.

Hybrid Recommendation System

There are different types of hybrid Recommender Systems – we will focus on the Parallelized Hybrid Recommender System. In this system, several Recommender Systems work in parallel to find the score (recommendation score) of an item. Using some technique these scores are aggregated to ascertain a recommendation for an item.

Mixed Hybrid: In this system recommended item from each recommender is presented together for the user. Suppose recommender 1 suggests 3 items and recommender 2 suggest 4 items then all the items will be presented to the user side by side.

Weighted Hybrid: In this system recommendation from different recommender are combined by computing weighted sum of their score. Suppose we have 2 Recommender System with the following recommendation scores for different items, and equal weights are assigned to both the recommenders, they could be ranked as shown below:

Now that you have seen different algorithms and methodologies that feed into Recommender Systems, you might be wondering two things if you're a business owner or in charge of improving the top/bottom lines at your organization – will a Recommender System add value to your business (online or otherwise) and if so, in which areas or functions? Also, how do you choose among the systems mentioned earlier?

Item1

Item2

Item3

Item4

Recommender 1 Recommender 2 Weighted Score Rank

9

7

5

8

6 7.5 2

8 7.5 2

6 5.5 4

9 8.5 1

Items

11

To answer the first question, in today's interconnected world of online commentary, re-tweets and shares, it becomes increasingly important for any business to have a finger on the pulse of its stakeholders – be it its customers, employees or even clients. Ala mom-and-pop stores that have a rapport with their customers and employees, large companies too now have the avenues and technologies at their disposal to impart a personal touch to and manage their interactions with customers. Those companies that make the best use of these technologies will not just have a competitive advantage over their peers, but the potential to disrupt their respective industries.

If you decide to proceed, ensure that you work with analytic professionals who understand your specific problem and identify and implement the system that fits your needs. At BRIDGEi2i, we have deep expertise across industries and methodologies, and work closely with customers to build robust recommendation systems that add great value to their business.

References Francesco Ricci, Lior Rokach and Bracha Shapira: Introduction to Recommender Systems Handbook, Chapter 1. Dietmar Jannach, Markus Zanker, Alexander Felfernig and Gerhard Friedrich: Recommender Systems An

Introduction, Cambridge University Press. Peter Brusilovsky with slides of Danielle Lee, Hybrid Recommendation, IS2480 Adaptive Information Systems.

Office: 389, 2nd Floor, 9th Main, HSR Layout, Sector – 7, Bangalore – 560 102 Phone: (India) +91-80-42102154, (US) +1-650-752-8979

Web: www.bridgei2i.com | email: [email protected] | Twitter | Google+ | LinkedIn: BRIDGEi2i

About BRIDGEi2i

BRIDGEi2i provides Business Analytics Solutions to enterprises globally, enabling them to achieve accelerated business impact harnessing the power of data. These analytics services and technology solutions enable business managers to consume more meaningful information from big data, generate actionable insights from complex business problems and make data driven decisions across pan-enterprise processes to create sustainable business impact. BRIDGEi2i has featured among the top 10 analytics and big data start-ups in several coveted publications.