Giter Club home page Giter Club logo

contextual_bandits_tree's Introduction

Contextual Bandits Decision Tree

This repo houses a python implementation of the decision tree designed by Feraud, R. , Allesarido, R. , Urvoy, T. & Clerot, F. in Random Forest for the Contextual Bandit Problem

The orignal version was only designed for use with binary variables, however, additions have been made to allow for continuous and categorical variables. A statistical test has also been added to each feature-value split to ensure only statistically significant results are used.

The tree consists of nodes which will choose the best feature and value to split on according to expected maximum reward when using the variable to select the best action. Action selection is then achieved at each leaf node by using Thompson Sampling, that is, modeling each possible action with a Beta distribution with a = #clicks and b=#opens.

Currently a proportion z-test is being used to test for statistical significance so only 2 actions are available in its current form, however I plan on switching to a proportion chi square test to allow for more actions.

Algorithm Visualization

Usage

Walk Through of Decision Tree Usage

Simulated Data Creation

Requirements/Dependencies

  • python 3
  • numpy
  • pandas
  • statsmodels
  • random

Citation

Acknowledgments

The decision tree python code structure was heavily inspired by the following sources:

contextual_bandits_tree's People

Contributors

mathtodon 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.