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

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