# NOT RUN {
horizon <- 800L
simulations <- 100L
bandit <- ContextualHybridBandit$new(k = 100, shared_features = 10, unique_features = 2)
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 = "bottomright")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab