Skip to contents

This is an internal function

Usage

get_reward(
  new_anchor,
  round,
  dist_func,
  model_func,
  dataset,
  instance_id,
  class_ind = 1,
  verbose
)

Arguments

new_anchor

Object of class anchor.

round

Numerical. A value to round the coverage by.

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

dataset

Data frame used in the algorithm

instance_id

The row index of the target instance in the dataset argument

class_ind

Numeric. The index of the required class when ordered alphabetically

verbose

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

Value

List containing the reward, the precision and the coverage