# NOT RUN {
horizon <- 800L
simulations <- 30L
bandit <- ContextualLogitBandit$new(k = 5, d = 5, intercept = TRUE)
agents <- list(Agent$new(ContextualLinTSPolicy$new(0.1), bandit),
Agent$new(EpsilonGreedyPolicy$new(0.1), bandit),
Agent$new(LinUCBGeneralPolicy$new(0.6), bandit),
Agent$new(ContextualEpochGreedyPolicy$new(8), bandit),
Agent$new(LinUCBHybridOptimizedPolicy$new(0.6), bandit),
Agent$new(LinUCBDisjointOptimizedPolicy$new(0.6), bandit))
simulation <- Simulator$new(agents, horizon, simulations)
history <- simulation$run()
plot(history, type = "cumulative", regret = FALSE,
rate = TRUE, legend_position = "right")
# }
Run the code above in your browser using DataLab