get_arm_context: Return context vector of an arm

Description Usage Arguments Value

View source: R/functions_utility.R

Description

Given d x k matrix or d dimensional vector X, returns a vector with arm's context.

Usage

1
2
3
4
5
6
get_arm_context(
  context,
  arm,
  select_features = NULL,
  prepend_arm_vector = FALSE
)

Arguments

context

a context list containing a d x k Matrix or d dimensional context vector X, the number of features d and number of arms k.

arm

index of arm.

select_features

indices of to be returned features.

prepend_arm_vector

prepend a one-hot-encoded arm vector to the returned context vector. That is, when k = 5 arms, and the to be returned arm vector is arm 3, prepend c(0,0,1,0,0)

Value

Vector that represents context related to an arm


contextual documentation built on July 26, 2020, 1:06 a.m.