Skip to main content
. 2022 Aug 21;12(8):1277. doi: 10.3390/life12081277
Algorithm 3 Contextual bandit for clinical trial optimization
  • 1:

    for m=1,2,,2Ddo              ▹ initialize all context-free bandits

  • 2:

        MAB(m)initialize context-free bandit()

  • 3:

    fori=1,2,,do

  • 4:

        Xiobserve context(patient i)

  • 5:

        MAB=MAB(Xi)             ▹ bandit associated with context Xi

  • 6:

        Uiselect treatment(MAB)   ▹ select a treatment based on priors in MAB

  • 7:

        Apply Ui and observe Ci

  • 8:

        update prior(Ui, MAB)          ▹ update the prior of Ui in MAB