get_arm_context {contextual}R Documentation

Return context vector of an arm

Description

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

Usage

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


[Package contextual version 0.9.8.4 Index]