Core

Contextual’s core classes.

Bandit

Bandit: Superclass

Policy

Policy: Superclass

Agent

Agent

Simulator

Simulator

History

History

Plot

Plot

Bandits

Contextual’s Bandit implementations

Bandit

Bandit: Superclass

BasicBernoulliBandit

Bandit: BasicBernoulliBandit

BasicGaussianBandit

Bandit: BasicGaussianBandit

ContextualBernoulliBandit

Bandit: Naive Contextual Bernouilli Bandit

ContextualBinaryBandit

Bandit: ContextualBinaryBandit

ContextualHybridBandit

Bandit: ContextualHybridBandit

ContextualLinearBandit

Bandit: ContextualLinearBandit

ContextualLogitBandit

Bandit: ContextualLogitBandit

ContextualPrecachingBandit

Bandit: ContextualPrecachingBandit

ContextualWheelBandit

Bandit: ContextualWheelBandit

ContinuumBandit

Bandit: ContinuumBandit

OfflineBootstrappedReplayBandit

Bandit: Offline Bootstrapped Replay

OfflineDirectMethodBandit

Bandit: Offline Direct Methods

OfflineDoublyRobustBandit

Bandit: Offline Doubly Robust

OfflineLookupReplayEvaluatorBandit

Bandit: Offline Replay with lookup tables

OfflinePropensityWeightingBandit

Bandit: Offline Propensity Weighted Replay

OfflineReplayEvaluatorBandit

Bandit: Offline Replay

Policies

Contextual’s Policy implementations.

BootstrapTSPolicy

Policy: Thompson sampling with the online bootstrap

ContextualEpochGreedyPolicy

Policy: A Time and Space Efficient Algorithm for Contextual Linear Bandits

ContextualEpsilonGreedyPolicy

Policy: ContextualEpsilonGreedyPolicy with unique linear models

ContextualLinTSPolicy

Policy: Linear Thompson Sampling with unique linear models

ContextualLogitBTSPolicy

Policy: ContextualLogitBTSPolicy

ContextualTSProbitPolicy

Policy: ContextualTSProbitPolicy

EpsilonFirstPolicy

Policy: Epsilon First

EpsilonGreedyPolicy

Policy: Epsilon Greedy

Exp3Policy

Policy: Exp3

FixedPolicy

Policy: Fixed Arm

GittinsBrezziLaiPolicy

Policy: Gittins Approximation algorithm for choosing arms in a MAB problem.

GradientPolicy

Policy: Gradient

LifPolicy

Policy: Continuum Bandit Policy with Lock-in Feedback

LinUCBDisjointOptimizedPolicy

Policy: LinUCB with unique linear models

LinUCBDisjointPolicy

Policy: LinUCB with unique linear models

LinUCBGeneralPolicy

Policy: LinUCB with unique linear models

LinUCBHybridOptimizedPolicy

Policy: LinUCB with hybrid linear models

LinUCBHybridPolicy

Policy: LinUCB with hybrid linear models

OraclePolicy

Policy: Oracle

Policy

Policy: Superclass

RandomPolicy

Policy: Random

SoftmaxPolicy

Policy: Softmax

ThompsonSamplingPolicy

Policy: Thompson Sampling

UCB1Policy

Policy: UCB1

UCB2Policy

Policy: UCB2

Utility functions

Contextual utility functions.

data_table_factors_to_numeric()

Convert all factor columns in data.table to numeric

get_global_seed()

Lookup .Random.seed in global environment

set_global_seed()

Set .Random.seed to a pre-saved value

get_arm_context()

Return context vector of an arm

get_full_context()

Get full context matrix over all arms

`dec<-`()

Decrement

`inc<-`()

Increment

inv()

Inverse from Choleski (or QR) Decomposition.

sum_of()

Sum of list

which_max_list()

Get maximum value in list

which_max_tied()

Get maximum value randomly breaking ties

sample_one_of()

Sample one element from vector or list

is_rstudio()

Check if in RStudio

set_external()

Change Default Graphing Device from RStudio

formatted_difftime()

Format difftime objects

dinvgamma() pinvgamma() qinvgamma() rinvgamma()

The Inverse Gamma Distribution

invlogit()

Inverse Logit Function

mvrnorm()

Simulate from a Multivariate Normal Distribution

one_hot()

One Hot Encoding of data.table columns

sherman_morrisson()

Sherman-Morrisson inverse

var_welford()

Welford's variance

prob_winner()

Binomial Win Probability

sim_post()

Binomial Posterior Simulator

value_remaining()

Potential Value Remaining

clipr()

Clip vectors

ind()

On-the-fly indicator function for use in formulae

Generic functions

Contextual generic functions.

summary(<History>)

Summary Method for Contextual History

print(<History>)

Print Method for Contextual History

plot(<History>)

Plot Method for Contextual History