Coder Social home page Coder Social logo

kiminh / contextual Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nth-iteration-labs/contextual

0.0 1.0 0.0 109.38 MB

Contextual Bandits in R - simulation and evaluation of Multi-Armed Bandit Policies

Home Page: https://nth-iteration-labs.github.io/contextual/

R 100.00%

contextual's Introduction

Contextual: Multi-Armed Bandits in R

lifecycle AppVeyor Build Status Build Status codecovLicense: GPL v3 DOI CRAN_Status_Badge

Overview

R package facilitating the simulation and evaluation of context-free and contextual Multi-Armed Bandit policies.

The package has been developed to:

  • Ease the implementation, evaluation and dissemination of both existing and new contextual Multi-Armed Bandit policies.
  • Introduce a wider audience to contextual bandit policies' advanced sequential decision strategies.

Package links:

Installation

To install contextual from CRAN:

install.packages('contextual')

To install the development version (requires the devtools package):

install.packages("devtools")
devtools::install_github('Nth-iteration-labs/contextual')

When working on or extending the package, clone its GitHub repository, then do:

install.packages("devtools")
devtools::install_deps(dependencies = TRUE)
devtools::build()
devtools::reload()

clean and rebuild...

Overview of core classes

Contextual consists of six core classes. Of these, the Bandit and Policy classes are subclassed and extended when implementing custom (synthetic or offline) bandits and policies. The other four classes (Agent, Simulator, History, and Plot) are the workhorses of the package, and generally need not be adapted or subclassed.

Documentation

See the demo directory for practical examples and replications of both synthetic and offline (contextual) bandit policy evaluations.

When seeking to extend contextual, it may also be of use to review "Extending Contextual: Frequently Asked Questions", before diving into the source code.

How to replicate figures from two introductory context-free Multi-Armed Bandits texts:

Basic, context-free multi-armed bandit examples:

Examples of both synthetic and offline contextual multi-armed bandit evaluations:

An example how to make use of the optional theta log to create interactive context-free bandit animations:

Some more extensive vignettes to get you started with the package:

Paper offering a general overview of the package's structure & API:

Policies and Bandits

Overview of contextual's growing library of contextual and context-free bandit policies:

General Context-free Contextual Other
Random
Oracle
Fixed





Epsilon-Greedy
Epsilon-First
UCB1, UCB2
Thompson Sampling
BootstrapTS
Softmax
Gradient
Gittins
CMAB Naive Epsilon-Greedy
Epoch-Greedy
LinUCB (General, Disjoint, Hybrid)
Linear Thompson Sampling
ProbitTS
LogitBTS
GLMUCB

Lock-in Feedback (LiF)







Overview of contextual's bandit library:

Basic Synthetic Contextual Synthetic Offline Continuous
Basic Bernoulli Bandit
Basic Gaussian Bandit



Contextual Bernoulli
Contextual Logit
Contextual Hybrid
Contextual Linear
Contextual Wheel
Replay Evaluator
Bootstrap Replay
Propensity Weighting
Direct Method
Doubly Robust
Continuum




Alternative parallel backends

By default, "contextual" uses R's built-in parallel package to facilitate parallel evaluation of multiple agents over repeated simulation. See the demo/alternative_parallel_backends directory for several alternative parallel backends:

Maintainers

Robin van Emden: author, maintainer* Maurits Kaptein: supervisor*

* Tilburg University / Jheronimus Academy of Data Science.

If you encounter a clear bug, please file a minimal reproducible example on GitHub.

contextual's People

Contributors

robinvanemden avatar g0ulash avatar

Watchers

James Cloos 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.