Skip to contents

This function is the main entrypoint that generates anchors by running a Multi-Armed Bandit algorithm

Usage

make_anchors(
  dataset,
  cols,
  instance,
  model_func,
  class_col,
  n_perturb_samples = 10000,
  n_games = 20,
  n_epochs = 100,
  seed = 145,
  verbose = FALSE,
  parallel = FALSE
)

Arguments

dataset

Dataset to use containing predictors and response variables.

cols

Columns of interest

instance

Id of the instance of interest in the training dataset

model_func

Function that gives takes in any data and the model to give predictions

class_col

Name of factor column containing class of interest

n_perturb_samples

number of samples to be taken from the pertubation distribution

n_games

Numeric. Number of games to play. Default to 20 games

n_epochs

Numeric. Number of epochs in a single game. Default to 100 epochs.

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

parallel

Logical. Whether to use parallel processing. Default set to FALSE.

Value

A data.frame of size 2 x (p+1) where p is the number of columns of interest with each row containing a upper. lower bound.