Giter Club home page Giter Club logo

bayesian-personalized-ranking's Introduction

Bayesian-Personalized-Ranking

Bayesian Personalised Ranking or One Class Collaborative Filtering for predicting whether a user reads a particular book. Details explained here

Solution mainly comprised of 3 steps:

Step 1: Trained a latent factor model for one class recommendation (OCCF).

Defined an embedding U for each userID and embedding B for each bookID. For each epoch, iterated through Train and for each (userID,bookID) generated N negative samples (userID,bookID’). Maximised Sigmoid( Dot(U[userID].B[bookID) - Dot(U[userID].B[bookID’] ) for all pairs.

(Latent Factor Size = 6, Gradient Descent (Adam Optimizer) with LR = 0.01, Lambda = 0.0001, ~250 epochs with LR reduced to 0.001 after 200 epochs, N = 20)

To make predictions for (userID,bookID) in Val, I looked at all other books read by the particular user and calculated the minimum score assigned (say s). I predicted 0 if the score assigned to (userID,bookID) < 0.50*s (if s > 0) or < s (if s < 0). Otherwise, I predicted 1. (Leaderboard score ~ 70-72%)

Step 2: Extracted features for (userID,bookID) pairs.

Feature Type 1: Look at the Jaccard Similarity between bookID and other books read by this user. Take the mean of the top K highest Jaccard similarities. Do this for K = 1,3,5,7.

Feature Type 2: Similar to Feature Type 1, but calculates Jaccard similarities between users. Do this for K = 1,3,5,7.

Feature Type 3: Popularity of books. Defined as the number of users who read this book divided by the total number of interactions.

Feature Type 4: Activity of users. Defined as the number of books read by this user divided by the total number of interactions.

Step 3: Boosting - With Logistic Regression

Trained a logistic regression model to predict 0/1 which takes as input the predictions of OCCF and features extracted in step 2. (Leaderboard score ~ 74-75%). This was fit on Val and evaluated on Test to avoid over-fitting (note that all features were scaled to [0,1] for training).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.