banditize: Create a multi-armed Bayesian bandit object.

Description Usage Arguments Details Value Examples

View source: R/bandit.R

Description

Fit a multi-armed bandit object based on a bayesTest which can serve recommendations and adapt to new data.

Usage

1
banditize(bT, param, higher_is_better = TRUE)

Arguments

bT

a bayesTest object

param

which model parameter (posterior) to evaluate; defaults to first param

higher_is_better

is a higher value of 'param' equivalent to a better choice?

Details

banditize is an 'object-oriented' implementation of multi-armed bandits in bayesAB. It is useful in conjunction with a Shiny app or Plumber deployment. The object itself is mutable and can adapt/learn from new data without having to re-assign the variable.

Comes with 5 methods:

Value

A bayesBandit object.

Examples

1
2
3
4
5
6
7
8
A_binom <- rbinom(100, 1, .5)
B_binom <- rbinom(100, 1, .6)

AB1 <- bayesTest(A_binom, B_binom, priors = c('alpha' = 1, 'beta' = 1), distribution = 'bernoulli')

binomialBandit <- banditize(AB1)
binomialBandit$serveRecipe()
binomialBandit$setResults(list('A' = c(1, 0, 1, 0, 0), 'B' = c(0, 0, 0, 0, 1)))

FrankPortman/bayesAB documentation built on June 25, 2021, 6:49 p.m.