Recommendation Engines: an Introduction

Click here to load reader

download Recommendation Engines: an Introduction

of 22

description

Recommendation Engines: an Introduction. Tom Rampley. A Brief History of Recommendation Engines. What Does a Recommender Do?. Collaborative Filtering. Cosine Similarity Example. Lets walk through an example of a simple collaborative filtering algorithm, namely cosine similarity - PowerPoint PPT Presentation

Transcript of Recommendation Engines: an Introduction

Recommendation Engines Presentation Outline

Tom RampleyRecommendation Engines: an IntroductionA Brief History of Recommendation Engines grouplens Started out as a collaborative filtering system for Usenet Housed at U-Minn Still used today, and active as a research center publish the widely used MovieLens data set amazon not the best recommender tech wise, but best at making money off of it

2What Does a Recommender Do? Recommenders all collect data on lots of users (or documents), and use that data to classify users or items as similar For documents, trying to identify themes from word clusters3Collaborative Filtering KNN used by Pandora People sitting around rating music on dimensions your likes and dislikes tell the system what characteristics to emphasize in your music BBNs are direct acyclic graphs with connections between nodes representing conditional probabilities Nave Bayes is a simple example of a BBN Can be augmented with tree structures, eliminating factor independence assumption Can be extended with logistic regression Harder to learn efficiently Markov decision processes Treat the recommendation process as sequential optimization problem Very linked with payoff optimization, which well touch on later Latent semantic indexing Document/word matrix decomposition technique Can be used without or without a probabilistic component Almost always used in search engines, but can be applied to other problems as well Association rule learning market basket analysis

4Cosine Similarity ExampleLets walk through an example of a simple collaborative filtering algorithm, namely cosine similarityCosine similarity can be used to find similar items, or similar individuals. In this case, well be trying to identify individuals with similar tasteImagine individual ratings on a set of items to be a [user,item] matrix. You can then treat the ratings of each individual as an N-dimensional vector of ratings on items: {r1, r2rN}The similarity of vectors (individuals ratings) can be computed by computing the cosine of the angle between them:

The closer the cosine is to 1, the more alike the two individuals ratings are

5Cosine Similarity Example ContinuedLets say we have the following matrix of users and ratings of TV shows:

And we encounter a new user, James, who has only seen and rated 5 of these 7 shows:

Of the two remaining shows, which one should we recommend to James?

True BloodCSIJAGStar TrekCastleThe WireTwin PeaksBob5214325Mary4421312Jim1152523George3435543Jennifer5242410Natalie0504414Robin5500422True BloodCSIJAGStar TrekCastleJames55310Cosine Similarity Example ContinuedTo find out, well see who James is most similar to among the folks who have rated all the shows by calculating the cosine similarity between the vectors of the 5 shows that each individual have in common:

It seems that Mary is the closest to James in terms of show ratings among the group. Of the two remaining shows, The Wire and Twin Peaks, Mary slightly preferred Twin Peaks so that is what we recommend to James

Cosine SimilarityJamesBob0.73Mary0.89Jim0.47George0.69Jennifer0.78Natalie0.50Robin0.79Collaborative Filtering ContinuedAdding ROI to the Equation: an Example with Nave BayesNave BayesP(A|B)=P(B|A)*P(A) / P(B) or posterior = likelihood * prior / evidence10Nave Bayes ContinuedHow does the NB algorithm generate class probabilities, and how can we use the algorithmic output to maximize expected payoff?Lets say we want to figure out which of two products to recommend to a customerEach product generates a different amount of profit for our firm per unit soldWe know the target customers past purchasing behavior, and we know the past purchasing behavior of twelve other customers who have bought one of the two potential recommendation productsLets represent our knowledge as a series of matrices and vectors

Nave Bayes Continued

Nave Bayes ContinuedNB uses (independent) probabilities of events to generate class probabilitiesUsing Bayes theorem (and ignoring the scaling constant) the probability of a customer with past purchase history (a vector of past purchases) buying item is:P (1, , i | j ) P (j )Where P (j) is the frequency with which the item appears in the training data, and P (1, , i | j ) is P (i | j ) for all i items in the training dataThat P (1, , i | j ) P (j ) = P (i | j ) P (j) is dependent up on the assumption of conditional independence between past purchases

Nave Bayes ContinuedIn our example, we can calculate the following probabilities:

Now that we can calculate P (1, , i | j ) P (j ) for all instances, lets figure out the most likely boat purchase for Eric:

These probabilities may seem very low, but recall that we left out the scaling constant in Bayes theorem since were only interested in the relative probabilities of the two outcomes

Nave Bayes ContinuedP()ToysGamesCandyBooksBoatEricSquirt GunLifeSnickersHarry Potter?Sailboat6/123/122/122/123/120.00086806Speedboat6/121/122/121/121/120.00004823Nave Bayes ContinuedChallengesDealing With Cold StartDealing With Data SparsityDealing With Data Sparsity

Techniques like principal components analysis/singular value decomposition allow for the creation of low rank approximations to sparse matrices with relatively little loss of informationSet of orthogonal principal components, each one captures the maximum amount of the remaining variance, each must be orthogonal to all the others- factors are used rather than original values20Dealing With Sheep of Varying DarknessTo a large extent, these cases are unavoidableFeedback on recommended items post purchase, as well as the purchase rate of recommended items, can be used to learn even very idiosyncratic preferences, but take longer than for a normal userGrey and black sheep are doubly troublesome because their odd tendencies can also weaken the strength of your engine to make recommendations to the broad population of white sheepReferencesA good survey of recommendation techniques

Matrix factorization for use in recommenders

Article on the BellKor solution to the Netflix challenge

Article on Amazon's recommendation engine

Vector Example

True BloodCSIJAGStar TrekCastleThe WireTwin PeaksBob5214325Mary4421312Jim1152523George3435543Jennifer5242410Natalie0504414Robin5500422

True BloodCSIJAGStar TrekCastleJames55310

Cosine SimilarityJamesBob0.73Mary0.89Jim0.47George0.69Jennifer0.78Natalie0.50Robin0.79

NB ExamplePast Customer Purchasing Behavior

ToysGamesCandyBooksBoatJohnSquirt GunChessSkittlesHarry PotterSpeedboatMaryDollLifeM&MsEmmaSpeedboatPeteKiteChessM&MsTwilightSailboatKevinSquirt GunLifeSnickersEmmaSailboatDaleDollLifeSkittlesTwilightSpeedboatJaneKiteMonopolySkittlesTwilightSpeedboatRaquelleSquirt GunMonopolySkittlesHarry PotterSailboatJoanneKiteChessSnickersTwilightSpeedboatSusanSquirt GunChessSkittlesTwilightSailboatTimDollLifeM&MsHarry PotterSailboatLarryKiteChessM&MsTwilightSpeedboatReginaDollMonopolySnickersHarry PotterSailboatEricSquirt GunLifeSnickersHarry Potter?

Sheet3

Vector Example

True BloodCSIJAGStar TrekCastleThe WireTwin PeaksBob5214325Mary4421312Jim1152523George3435543Jennifer5242410Natalie0504414Robin5500422

True BloodCSIJAGStar TrekCastleJames55310

Cosine SimilarityJamesBob0.73Mary0.89Jim0.47George0.69Jennifer0.78Natalie0.50Robin0.79

NB ExamplePast Customer Purchasing BehaviorSailboatSpeedboatP()6/126/12ToysGamesCandyBooksBoatJohnSquirt GunChessSkittlesHarry PotterSpeedboatSailboatSpeedboatMaryDollLifeM&MsEmmaSpeedboatSquirt Gun3/61/6PeteKiteChessM&MsTwilightSailboatKite1/63/6KevinSquirt GunLifeSnickersEmmaSailboatDoll2/62/6DaleDollLifeSkittlesTwilightSpeedboatLife2/62/6JaneKiteMonopolySkittlesTwilightSpeedboatMonopoly2/61/6RaquelleSquirt GunMonopolySkittlesHarry PotterSailboatChess2/63/6JoanneKiteChessSnickersTwilightSpeedboatSkittles2/63/6SusanSquirt GunChessSkittlesTwilightSailboatM&Ms2/62/6TimDollLifeM&MsHarry PotterSailboatSnickers2/61/6LarryKiteChessM&MsTwilightSpeedboatHarry Potter3/61/6ReginaDollMonopolySnickersHarry PotterSailboatTwilight2/64/6EricSquirt GunLifeSnickersHarry Potter?Emma1/61/6SailboatSpeedboatSailboatSpeedboatSquirt Gun31Squirt Gun50%33%Kite13Kite17%100%Doll22Doll33%67%Life22Life33%67%Monopoly21Monopoly33%33%Chess23Chess33%100%Skittles23Skittles33%100%M&Ms22M&Ms33%67%Snickers21Snickers33%33%Harry Potter31Harry Potter50%33%Twilight24Twilight33%133%Emma11Emma17%33%

P()ToysGamesCandyBooksBoatEricSquirt GunLifeSnickersHarry Potter?Sailboat6/123/122/122/123/120.0008680556Speedboat6/121/122/121/121/12