Description Usage Arguments Details Value Examples
Fit a multi-armed bandit object based on a bayesTest which can serve recommendations and adapt to new data.
1 |
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? |
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:
serveRecipe()
: serves a recipe to show your user based on samples from both posteriors.
setResults(results)
: set results for one or more recipes for one or more instances of feedback. Used to update bandit.
getBayesTest()
: returns most updated bayesTest
object.
getOriginalTest()
: returns original bayesTest
object without any updates.
getUpdates()
: returns a summarized version of all updates this bandit has processed.
A bayesBandit object.
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)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.