package prbnmcn-ucb1

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Parameters

module Arm : Arm_sig

Signature

type 'state t

The state of a bandit.

val create : Arm.t array -> ready_to_move t

Create a fresh bandit with given arms.

val next_action : ready_to_move t -> Arm.t * awaiting_reward t

Select the UCB1-optimal action to play. The bandit expects a reward.

val set_reward : awaiting_reward t -> float -> ready_to_move t

Assign a reward to the bandit. The reward must be in the 0,1 interval.

val total_rewards : ready_to_move t -> float

Total rewards obtained by the bandit.

val pp_stats : Stdlib.Format.formatter -> 'state t -> unit

Pretty-print useful statistics on the bandit, for debugging purposes.

OCaml

Innovation. Community. Security.