Options
All
  • Public
  • Public/Protected
  • All
Menu

Implementation of the Upper Confidence Bound algorithm

memberof

ml

Hierarchy

Implements

Index

Constructors

constructor

  • creates a new instance of the Upper confidence bound(UCB) algorithm. UCB is based on the principle of optimism in the face of uncertainty, which is to choose your actions as if the environment (in this case bandit) is as nice as is plausibly possible

    see

    http://banditalgs.com/2016/09/18/the-upper-confidence-bound-algorithm/

    example

    const dataset = new ms.ml.UpperConfidenceBound({bounds:10});

    prop

    {Map} this.numbers_of_selections - map of all bound selections

    prop

    {Map} this.sums_of_rewards - successful bound selections

    Parameters

    Returns UpperConfidenceBound

Properties

bounds

bounds: number

getBound

getBound: BoundFunction

iteration

iteration: number

last_selected

last_selected: Vector

numbers_of_selections

numbers_of_selections: Map<number, number>

sums_of_rewards

sums_of_rewards: Map<number, number>

total_reward

total_reward: number

Methods

learn

  • single step trainning method

    Parameters

    • Default value options: any = {}

    Returns UpperConfidenceBound

predict

  • predict(): number
  • returns next action based off of the upper confidence bound

    Returns number

    returns bound selection

train

  • train(options: any): this
  • training method for upper confidence bound calculations

    Parameters

    • options: any

    Returns this