Coder Social home page Coder Social logo

kaggle---google-local-visit-prediction's Introduction

(I have to admit that the codes in this repo are messy due to the deadline of the task)

Kaggle---Google-Local-visit-prediction

Predict whether users will visit a business using BPR

  • Who should read this: People want to know how to implement BPR (Bayesian Personalized Ranking from Implicit Feedback) https://www.ismll.uni-hildesheim.de/pub/pdfs/Rendle_et_al2009-Bayesian_Personalized_Ranking.pdf
  • Competition description: Predict given a (user,business) pair from 'pairs Visit.txt' whether the user visited the business (really, whether it was one of the business they reviewed). Accuracy will be measured in terms of the categorization accuracy (fraction of predictions you got right).
  • Data description:
    • businessID: The ID of the business. This is a hashed product identifier from Google.
    • userID: The ID of the reviewer. This is a hashed user identifier from Google.
    • rating: The star rating of the user’s review.
    • reviewText: The text of the review. It should be possible to successfully complete this assignment without making use of the review data, though an effective solution to the category prediction task will presumably make use of it.
    • reviewHash: Hash of the review (essentially a unique identifier for the review).
    • unixReviewTime: Time of the review in seconds since 1970.
    • reviewTime: Plain-text representation of the review time.
    • categories: Category labels of the product being reviewed.
  • Basic Concept of BPR:
    • Maximize the differences bewteen items that users prefer and not prefer, with a Gaussian distribution prior
    • Decompose the high dimensional users vectors into low dimensional ones, and still remain such differenes.
    • Regularization parameters on User, Positive item (prefered), Negative item (not prefered)
    • Stochastic gradient descent
  • Functions in the codes:
    • Sample function: each time sample a pair consists of user, positive item and negative item.
    • Update function: each time calculate the gradient of the three object and update their values simultaneously.
    • Train function: within given iterations, sample and update repeatedly.
    • Test function: test the cost function, to see whether to change learning rate.
    • To get the better result, I set the lambda to -0.1,-0.1,-0.2 for user, positive items, negative items respectively.
    • For stochastic gradient descent, I stop it when it vibrates when alpha is 0.01. Actually, it can be better, but I am not that patient to wait.

( In the paper, it is said lambda should be positive, but this will lead to overflow.)

Kaggle---Google-rating-prediction

I have uploaded the Latent Factor Model for rating prediction, which is included in the file

kaggle---google-local-visit-prediction's People

Contributors

renxiangyuan avatar

Watchers

 avatar

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.