Skip to contents

Run Multi-Armed bandit algorithm

Usage

run_mab(
  n_games,
  n_epochs,
  dataset,
  instance_id,
  environment,
  interest_cols,
  dist_func,
  model_func,
  class_ind,
  seed = 145,
  verbose
)

Arguments

n_games

Numeric. Number of games to play

n_epochs

Numeric. Number of epochs in a single game

dataset

The dataset to run algorithm on

instance_id

The index of the target observation in the datasert

environment

The environment of poss

interest_cols

The columns of interest

dist_func

Function that takes n as an argument and returns a data.frame of size n x p where p is the number of variables in the dataset

model_func

Function that takes in a data.frame of size m x p where m is the number of rows and p is the number of variables in the dataset and returns a vector of predictions of size m x 1

class_ind

Numeric. The index of the required class when ordered alphabetically

seed

Numeric. Seed to be used for the Multi-Armed Bandit algorithm. This ensures that the results stay consistent

verbose

Logical. Whether to print out diagnostics of the Multi-Armed Bandit Algorithm

Value

A tibble of 1 x (2*p) where p is the number of columns of interest