Code Monkey home page Code Monkey logo

multi-armed-bandit's Introduction

Multi-Armed Bandit

A multi-armed bandit simulator in Node.js.

Usage

npm start to run the simulation.

Overview

Each "bandit" represents a process with an uncertain outcome, like a one-armed bandit in a casino. Some bandits give higher rewards than others: a "lucky" machine. In this repository we implement a variety of different strategies that explore different bandits and then exploit the one they have detected to yield the highest reward to compare approaches.

In the real world, multi-armed bandits can be used for things like multivariate tests (a/b tests, but with potentially more variants). If one variant yields a significantly better outcome than others, we don't want an even split over the course of the experiment as we would get a better overall result by sending more samples to the superior variant.

In concrete terms, imagine we have a new checkout that doubles a creator's sales. If we detect that the checkout really does work, we want to send as many people to this variant as we can while still performing a statistically significant experiment.

Strategies

Naieve

This strategy simply picks the first bandit every time.

Random

This strategy picks a random bandit every time.

Ideal

This strategy picks the best bandit every time (by cheating).

EpsilonGreedy

Some of the time, select a random bandit. Other times, select the best recorded bandit. The variable "epsilon" controls how frequently we explore versus exploit.

multi-armed-bandit's People

Contributors

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