SlideShare a Scribd company logo
BANDIT ALGORITHMS
Max Pagels, Data Science Specialist
max.pagels@sc5.io, @maxpagels
13.10.2016
Learning about the world
PROGRAMMING, IN A NUTSHELL
OUTPUTINPUT
ALGORITHM
MACHINE LEARNING, IN A NUTSHELL
PROGRAMINPUT & OUTPUT
LEARNING ALGORITHM
REINFORCEMENT LEARNING, IN A NUTSHELL
ACTION
WORLD
OBSERVATION
AGENT
REWARD
LEARNING HOW TO PLAY TETRIS
ACTION
WORLD
OBSERVATION
AGENT
REWARD
(Rotate/Up/Down/
Left/Right etc)
Score since
previous action
THE (STOCHASTIC)
MULTI-ARMED
BANDIT PROBLEM
Let’s say you are in a Las Vegas casino, and
there are three vacant slot machines (one-
armed bandits). Pulling the arm of a machine
yields either $0 or $1.
Given these three bandit machines, each with
an unknown payoff strategy, how should we
choose which arm to pull to maximise* the
expected reward over time?



* Equivalently, we want to minimise the expected
regret over time (minimise how much money we
lose).
FORMALLY(ISH)
Problem
We have three one-armed bandits. Each arm
yields a reward of $1 according to some fixed
unknown probability Pa , or a reward of $0 with
probability 1-Pa.
Objective
Find Pa, ∀a ∈ {1,2,3}
OBSERVATION #1
This is a partial information problem: when we
pull an arm, we don’t get to see the rewards of
the arms we didn’t pull.
(For math nerds: a bandit problem is an MDP
with a single, terminal, state).
OBSERVATION #2
We need to create some approximation, or best
guess, of how the world works in order to
maximise our reward over time.
We need to create a model.
“All models are wrong but some are useful” —
George Box
OBSERVATION #3
Clearly, we need to try (explore) the arms of all
the machines, to get a sense of which one is
best.
OBSERVATION #4
Though exploration is necessary, we also need
to choose the best arm as much as possible
(exploit) to maximise our reward over time.
THE EXPLORE/EXPLOIT TUG OF WAR
HOW DO WE SOLVE THE BANDIT PROBLEM?
A NAÏVE ALGORITHM
Step 1: For the first N pulls
Evenly pull all the arms, keeping track of the
number of pulls & wins per arm
Step 2: For the remaining M pulls
Choose the arm the the highest expected
reward
A NAÏVE ALGORITHM
Step 1: For the first N pulls
Evenly pull all the arms, keeping track of the
number of pulls & wins per arm
Step 2: For the remaining M pulls
Choose the arm the the highest expected
reward
Arm 1: {trials: 100, wins: 2}
Arm 2: {trials: 100, wins: 21}
Arm 3: {trials: 100, wins: 17}
Arm 1: 2/100 = 0.02
Arm 2: 21/100 = 0.21
Arm 3: 17/100 = 0.17
A NAÏVE ALGORITHM
Step 1: For the first N pulls
Evenly pull all the arms, keeping track of the
number of pulls & wins per arm
Step 2: For the remaining M pulls
Choose the arm the the highest expected
reward
Arm 1: {trials: 100, wins: 2}
Arm 2: {trials: 100, wins: 21}
Arm 3: {trials: 100, wins: 17}
Arm 1: 2/100 = 0.02
Arm 2: 21/100 = 0.21
Arm 3: 17/100 = 0.17
Explore
Exploit
EPOCH-GREEDY [1]
Step 1: For the first N pulls
Evenly pull all the arms, keeping track of the
number of pulls & wins per arm
Step 2: For the remaining M pulls
Choose the arm the the highest expected
reward
Arm 1: {trials: 100, wins: 2}
Arm 2: {trials: 100, wins: 21}
Arm 3: {trials: 100, wins: 17}
Arm 1: 2/100 = 0.02
Arm 2: 21/100 = 0.21
Arm 3: 17/100 = 0.17
Explore
Exploit
[1]: http://hunch.net/~jl/projects/interactive/sidebandits/bandit.pdf
EPSILON-GREEDY/Ε-GREEDY [2]
Choose a value for the hyperparameter ε
Loop forever
With probability ε:
Choose an arm uniformly at random, keep track of trials and wins
With probability 1-ε:
Choose the arm the the highest expected reward
Explore
Exploit
[2]: people.inf.elte.hu/lorincz/Files/RL_2006/SuttonBook.pdf
OBSERVATIONS
For N = 300 and M = 1000, the Epoch-Greedy algorithm will choose
something other than the best arm 200 times, or about 15% of the time.
At each turn, the ε-Greedy algorithm will choose something other than the
best arm with probability P=(ε/n) × (n-1), n=number of arms. It will always
explore with this probability, no matter how many time steps we have
done.
Ε-GREEDY: SUB-OPTIMAL LINEAR REGRET*
- O(N)Cumulativeregret
4
Timesteps
*Assuming no annealing
THOMPSON SAMPLING ALGORITHM
For each arm, initialise a uniform probability distribution (prior)
Loop forever
Step 1: sample randomly from the probability distribution of each
arm
Step 2: choose the arm with the highest sample value
Step 3: observe reward for the chosen and update the
hyperparameters of its probability distribution (posterior)
EXAMPLE WITH TWO ARMS (BLUE & GREEN)
Assumption: rewards follow a Bernoulli process, which allows us to use a 𝛽-distribution as a
conjugate prior.
FIRST, INITIALISE A UNIFORM RANDOM PROB.
DISTRIBUTION FOR BLUE AND GREEN
0 10 1
FIRST, INITIALISE A UNIFORM RANDOM PROB.
DISTRIBUTION FOR BLUE AND GREEN
0 1
EXAMPLE WITH TWO ARMS (BLUE & GREEN)
RANDOMLY SAMPLE FROM BOTH ARMS (BLUE GETS THE
HIGHER VALUE IN THIS EXAMPLE)
0 1
EXAMPLE WITH TWO ARMS (BLUE & GREEN)
PULL BLUE , OBSERVE REWARD (LET’S SAY WE GOT A
REWARD OF 1)
0 1
EXAMPLE WITH TWO ARMS (BLUE & GREEN)
UPDATE DISTRIBUTION OF BLUE
0 1
EXAMPLE WITH TWO ARMS (BLUE & GREEN)
REPEAT THE PROCESS: SAMPLE, CHOOSE ARM WITH
HIGHEST SAMPLE VALUE, OBSERVE REWARD, UPDATE.
0 1
EXAMPLE WITH TWO ARMS (BLUE & GREEN)
0 1
AFTER 100 TIMESTEPS, THE DISTRIBUTIONS MIGHT LOOK
LIKE THIS
EXAMPLE WITH TWO ARMS (BLUE & GREEN)
0 1
AFTER 1,000 TIMESTEPS, THE DISTRIBUTIONS MIGHT LOOK
LIKE THIS: THE PROCESS HAS CONVERGED.
EXAMPLE WITH TWO ARMS (BLUE & GREEN)
THOMPSON SAMPLING: LOGARITHMIC REGRET -
O(LOG(N))Cumulativeregret
100
Timesteps
MULTI-ARMED BANDITS ARE
GOOD…
So far, we’ve covered the “vanilla” multi-armed bandit problem. Solving this
problem lets us find the globally best arm to maximise our expected reward
over time.
However, depending on the problem, the globally best arm may not always
be the best arm.
…BUT CONTEXTUAL BANDITS
ARE THE HOLY GRAIL
The the contextual bandit setting, once we pull an arm and receive a reward,
we also get to see a context vector associated with the reward. The
objective is now to maximise the expected reward over time given the
context at each time step.
Solving this problem gives us a higher reward over time in situations where
the globally best arm isn’t always the best arm.
Example algorithm: Thompson Sampling with Linear Payoffs [3]
[3]: https://arxiv.org/abs/1209.3352
…ACTUALLY, ADVERSARIAL
CONTEXTUAL BANDITS ARE THE
HOLY GRAIL
Until now, we’ve assumed that each one-armed bandit gives a $100 reward
according to some unknown probability P. In real-world scenarios, the world
rarely behaves this well. Instead of a simple dice roll, the bandit may pay out
differently depending on the day/hour/amount of money in the machine. It
works as an adversary of sorts.
A bandit algorithm that is capable of dealing with changes in payoff
structures in a reasonable amount of time tend to work better than
stochastic bandits in real-world settings.
Example algorithm: EXP4 (a.k.a the “Monster” algorithm) [4]
[4]: https://arxiv.org/abs/1002.4058
CONTEXTUAL BANDIT
ALGORITHMS ARE 1) STATE-OF-
THE-ART & 2) COMPLEX
• Many algorithms are <5 years old. Some of the most interesting ones
are less than a year old.
• Be prepared to read lots of academic papers and struggle
implementing the algorithms.
• Don’t hesitate to contact the authors if there is some detail you don’t
understand (thanks John Langford and Shipra Agrawal!)
• Always remember to simulate and validate bandits using real data.
REAL-WORLD APPLICATIONS OF BANDITS
MEDICAL TREATMENTS
BIVARIATE & MULTIVARIATE TESTING
Vanilla MAB
UI OPTIMISATION
CODEC SELECTION
ONLINE MATCHMAKING
PERSONALISED RECOMMENDATIONS
… & COUNTLESS OTHER POSSIBILITIES
TIP: CONTEXTUAL BANDIT IMPLEMENTED IN
PYTHON + LAMBDA + API GATEWAY + REDIS
= OPTIMISATION ENGINE
DEMO: HTTPS://
MWTDS.AZUREWEBSITES.NET/HOME/
APITESTDRIVE
LAUNCHED YESTERDAY (!): AZURE
CUSTOM DECISION SERVICE
IF YOU CAN MODEL IT AS A
GAME, YOU CAN USE A BANDIT
ALGORITHM TO SOLVE IT*.
*Given rewards that aren’t delayed.
THANK YOU
Questions?

More Related Content

PDF
Artwork Personalization at Netflix
PDF
Spaceships 解説
PDF
ダブル配列の豆知識
PDF
C++ マルチスレッドプログラミング
DOCX
алгоритм
PPTX
Thuật toán Slope One (final)
PPTX
Palindromic tree
PDF
Practical AI for Business: Bandit Algorithms
Artwork Personalization at Netflix
Spaceships 解説
ダブル配列の豆知識
C++ マルチスレッドプログラミング
алгоритм
Thuật toán Slope One (final)
Palindromic tree
Practical AI for Business: Bandit Algorithms

Similar to Bandit Algorithms (20)

PDF
bandits problems robert platt northeaster.pdf
PDF
Reinforcement Learning 2. Multi-armed Bandits
PDF
Bandit algorithms for website optimization - A summary
PDF
Multi-Armed Bandit: an algorithmic perspective
PDF
NON-STATIONARY BANDIT CHANGE DETECTION-BASED THOMPSON SAMPLING ALGORITHM
PDF
DRL #2-3 - Multi-Armed Bandits .pptx.pdf
PDF
Introduction to Multi-armed Bandits
PDF
Multi-armed Bandits
PDF
NON-STATIONARY BANDIT CHANGE DETECTION-BASED THOMPSON SAMPLING ALGORITHM: A R...
PPTX
mcp-bandits.pptx
PDF
Rotting Infinitely Many-Armed Bandits
PPTX
Byron Galbraith, Chief Data Scientist, Talla, at MLconf NYC 2017
ODP
Choosing between several options in uncertain environments
PDF
Multi-Armed Bandit and Applications
PDF
Contextual Bandit Survey
PPTX
Practical contextual bandits for business
PDF
07-Richard-Combes Multi-Armed Bandits.pdf
PDF
Multi-Armed Bandits:
 Intro, examples and tricks
PDF
Learning for exploration-exploitation in reinforcement learning. The dusk of ...
PDF
Meta-learning of exploration-exploitation strategies in reinforcement learning
bandits problems robert platt northeaster.pdf
Reinforcement Learning 2. Multi-armed Bandits
Bandit algorithms for website optimization - A summary
Multi-Armed Bandit: an algorithmic perspective
NON-STATIONARY BANDIT CHANGE DETECTION-BASED THOMPSON SAMPLING ALGORITHM
DRL #2-3 - Multi-Armed Bandits .pptx.pdf
Introduction to Multi-armed Bandits
Multi-armed Bandits
NON-STATIONARY BANDIT CHANGE DETECTION-BASED THOMPSON SAMPLING ALGORITHM: A R...
mcp-bandits.pptx
Rotting Infinitely Many-Armed Bandits
Byron Galbraith, Chief Data Scientist, Talla, at MLconf NYC 2017
Choosing between several options in uncertain environments
Multi-Armed Bandit and Applications
Contextual Bandit Survey
Practical contextual bandits for business
07-Richard-Combes Multi-Armed Bandits.pdf
Multi-Armed Bandits:
 Intro, examples and tricks
Learning for exploration-exploitation in reinforcement learning. The dusk of ...
Meta-learning of exploration-exploitation strategies in reinforcement learning
Ad

More from SC5.io (12)

PDF
AWS Machine Learning & Google Cloud Machine Learning
PDF
Transfer learning with Custom Vision
PDF
Decision trees & random forests
PDF
Machine Learning Using Cloud Services
PDF
Angular.js Primer in Aalto University
PDF
Miten design-muutosjohtaminen hyödyttää yrityksiä?
PDF
Securing the client side web
PDF
Engineering HTML5 Applications for Better Performance
PDF
2013 10-02-backbone-robots-aarhus
PDF
2013 10-02-html5-performance-aarhus
PDF
2013 04-02-server-side-backbone
PPTX
Building single page applications
AWS Machine Learning & Google Cloud Machine Learning
Transfer learning with Custom Vision
Decision trees & random forests
Machine Learning Using Cloud Services
Angular.js Primer in Aalto University
Miten design-muutosjohtaminen hyödyttää yrityksiä?
Securing the client side web
Engineering HTML5 Applications for Better Performance
2013 10-02-backbone-robots-aarhus
2013 10-02-html5-performance-aarhus
2013 04-02-server-side-backbone
Building single page applications
Ad

Recently uploaded (20)

PPT
Quality review (1)_presentation of this 21
PPTX
05. PRACTICAL GUIDE TO MICROSOFT EXCEL.pptx
PPTX
Introduction to Firewall Analytics - Interfirewall and Transfirewall.pptx
PDF
Mega Projects Data Mega Projects Data
PPTX
Database Infoormation System (DBIS).pptx
PPTX
1_Introduction to advance data techniques.pptx
PPTX
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
PPTX
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
PDF
Foundation of Data Science unit number two notes
PDF
Introduction to Business Data Analytics.
PPTX
DISORDERS OF THE LIVER, GALLBLADDER AND PANCREASE (1).pptx
PPTX
oil_refinery_comprehensive_20250804084928 (1).pptx
PPT
Miokarditis (Inflamasi pada Otot Jantung)
PPT
Chapter 2 METAL FORMINGhhhhhhhjjjjmmmmmmmmm
PPTX
Introduction-to-Cloud-ComputingFinal.pptx
PPTX
CEE 2 REPORT G7.pptxbdbshjdgsgjgsjfiuhsd
PPTX
IB Computer Science - Internal Assessment.pptx
PPTX
Supervised vs unsupervised machine learning algorithms
PDF
Fluorescence-microscope_Botany_detailed content
Quality review (1)_presentation of this 21
05. PRACTICAL GUIDE TO MICROSOFT EXCEL.pptx
Introduction to Firewall Analytics - Interfirewall and Transfirewall.pptx
Mega Projects Data Mega Projects Data
Database Infoormation System (DBIS).pptx
1_Introduction to advance data techniques.pptx
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
Foundation of Data Science unit number two notes
Introduction to Business Data Analytics.
DISORDERS OF THE LIVER, GALLBLADDER AND PANCREASE (1).pptx
oil_refinery_comprehensive_20250804084928 (1).pptx
Miokarditis (Inflamasi pada Otot Jantung)
Chapter 2 METAL FORMINGhhhhhhhjjjjmmmmmmmmm
Introduction-to-Cloud-ComputingFinal.pptx
CEE 2 REPORT G7.pptxbdbshjdgsgjgsjfiuhsd
IB Computer Science - Internal Assessment.pptx
Supervised vs unsupervised machine learning algorithms
Fluorescence-microscope_Botany_detailed content

Bandit Algorithms

  • 1. BANDIT ALGORITHMS Max Pagels, Data Science Specialist max.pagels@sc5.io, @maxpagels 13.10.2016 Learning about the world
  • 2. PROGRAMMING, IN A NUTSHELL OUTPUTINPUT ALGORITHM
  • 3. MACHINE LEARNING, IN A NUTSHELL PROGRAMINPUT & OUTPUT LEARNING ALGORITHM
  • 4. REINFORCEMENT LEARNING, IN A NUTSHELL ACTION WORLD OBSERVATION AGENT REWARD
  • 5. LEARNING HOW TO PLAY TETRIS ACTION WORLD OBSERVATION AGENT REWARD (Rotate/Up/Down/ Left/Right etc) Score since previous action
  • 6. THE (STOCHASTIC) MULTI-ARMED BANDIT PROBLEM Let’s say you are in a Las Vegas casino, and there are three vacant slot machines (one- armed bandits). Pulling the arm of a machine yields either $0 or $1. Given these three bandit machines, each with an unknown payoff strategy, how should we choose which arm to pull to maximise* the expected reward over time?
 
 * Equivalently, we want to minimise the expected regret over time (minimise how much money we lose).
  • 7. FORMALLY(ISH) Problem We have three one-armed bandits. Each arm yields a reward of $1 according to some fixed unknown probability Pa , or a reward of $0 with probability 1-Pa. Objective Find Pa, ∀a ∈ {1,2,3}
  • 8. OBSERVATION #1 This is a partial information problem: when we pull an arm, we don’t get to see the rewards of the arms we didn’t pull. (For math nerds: a bandit problem is an MDP with a single, terminal, state).
  • 9. OBSERVATION #2 We need to create some approximation, or best guess, of how the world works in order to maximise our reward over time. We need to create a model. “All models are wrong but some are useful” — George Box
  • 10. OBSERVATION #3 Clearly, we need to try (explore) the arms of all the machines, to get a sense of which one is best.
  • 11. OBSERVATION #4 Though exploration is necessary, we also need to choose the best arm as much as possible (exploit) to maximise our reward over time.
  • 13. HOW DO WE SOLVE THE BANDIT PROBLEM?
  • 14. A NAÏVE ALGORITHM Step 1: For the first N pulls Evenly pull all the arms, keeping track of the number of pulls & wins per arm Step 2: For the remaining M pulls Choose the arm the the highest expected reward
  • 15. A NAÏVE ALGORITHM Step 1: For the first N pulls Evenly pull all the arms, keeping track of the number of pulls & wins per arm Step 2: For the remaining M pulls Choose the arm the the highest expected reward Arm 1: {trials: 100, wins: 2} Arm 2: {trials: 100, wins: 21} Arm 3: {trials: 100, wins: 17} Arm 1: 2/100 = 0.02 Arm 2: 21/100 = 0.21 Arm 3: 17/100 = 0.17
  • 16. A NAÏVE ALGORITHM Step 1: For the first N pulls Evenly pull all the arms, keeping track of the number of pulls & wins per arm Step 2: For the remaining M pulls Choose the arm the the highest expected reward Arm 1: {trials: 100, wins: 2} Arm 2: {trials: 100, wins: 21} Arm 3: {trials: 100, wins: 17} Arm 1: 2/100 = 0.02 Arm 2: 21/100 = 0.21 Arm 3: 17/100 = 0.17 Explore Exploit
  • 17. EPOCH-GREEDY [1] Step 1: For the first N pulls Evenly pull all the arms, keeping track of the number of pulls & wins per arm Step 2: For the remaining M pulls Choose the arm the the highest expected reward Arm 1: {trials: 100, wins: 2} Arm 2: {trials: 100, wins: 21} Arm 3: {trials: 100, wins: 17} Arm 1: 2/100 = 0.02 Arm 2: 21/100 = 0.21 Arm 3: 17/100 = 0.17 Explore Exploit [1]: http://hunch.net/~jl/projects/interactive/sidebandits/bandit.pdf
  • 18. EPSILON-GREEDY/Ε-GREEDY [2] Choose a value for the hyperparameter ε Loop forever With probability ε: Choose an arm uniformly at random, keep track of trials and wins With probability 1-ε: Choose the arm the the highest expected reward Explore Exploit [2]: people.inf.elte.hu/lorincz/Files/RL_2006/SuttonBook.pdf
  • 19. OBSERVATIONS For N = 300 and M = 1000, the Epoch-Greedy algorithm will choose something other than the best arm 200 times, or about 15% of the time. At each turn, the ε-Greedy algorithm will choose something other than the best arm with probability P=(ε/n) × (n-1), n=number of arms. It will always explore with this probability, no matter how many time steps we have done.
  • 20. Ε-GREEDY: SUB-OPTIMAL LINEAR REGRET* - O(N)Cumulativeregret 4 Timesteps *Assuming no annealing
  • 21. THOMPSON SAMPLING ALGORITHM For each arm, initialise a uniform probability distribution (prior) Loop forever Step 1: sample randomly from the probability distribution of each arm Step 2: choose the arm with the highest sample value Step 3: observe reward for the chosen and update the hyperparameters of its probability distribution (posterior)
  • 22. EXAMPLE WITH TWO ARMS (BLUE & GREEN) Assumption: rewards follow a Bernoulli process, which allows us to use a 𝛽-distribution as a conjugate prior. FIRST, INITIALISE A UNIFORM RANDOM PROB. DISTRIBUTION FOR BLUE AND GREEN 0 10 1
  • 23. FIRST, INITIALISE A UNIFORM RANDOM PROB. DISTRIBUTION FOR BLUE AND GREEN 0 1 EXAMPLE WITH TWO ARMS (BLUE & GREEN)
  • 24. RANDOMLY SAMPLE FROM BOTH ARMS (BLUE GETS THE HIGHER VALUE IN THIS EXAMPLE) 0 1 EXAMPLE WITH TWO ARMS (BLUE & GREEN)
  • 25. PULL BLUE , OBSERVE REWARD (LET’S SAY WE GOT A REWARD OF 1) 0 1 EXAMPLE WITH TWO ARMS (BLUE & GREEN)
  • 26. UPDATE DISTRIBUTION OF BLUE 0 1 EXAMPLE WITH TWO ARMS (BLUE & GREEN)
  • 27. REPEAT THE PROCESS: SAMPLE, CHOOSE ARM WITH HIGHEST SAMPLE VALUE, OBSERVE REWARD, UPDATE. 0 1 EXAMPLE WITH TWO ARMS (BLUE & GREEN)
  • 28. 0 1 AFTER 100 TIMESTEPS, THE DISTRIBUTIONS MIGHT LOOK LIKE THIS EXAMPLE WITH TWO ARMS (BLUE & GREEN)
  • 29. 0 1 AFTER 1,000 TIMESTEPS, THE DISTRIBUTIONS MIGHT LOOK LIKE THIS: THE PROCESS HAS CONVERGED. EXAMPLE WITH TWO ARMS (BLUE & GREEN)
  • 30. THOMPSON SAMPLING: LOGARITHMIC REGRET - O(LOG(N))Cumulativeregret 100 Timesteps
  • 31. MULTI-ARMED BANDITS ARE GOOD… So far, we’ve covered the “vanilla” multi-armed bandit problem. Solving this problem lets us find the globally best arm to maximise our expected reward over time. However, depending on the problem, the globally best arm may not always be the best arm.
  • 32. …BUT CONTEXTUAL BANDITS ARE THE HOLY GRAIL The the contextual bandit setting, once we pull an arm and receive a reward, we also get to see a context vector associated with the reward. The objective is now to maximise the expected reward over time given the context at each time step. Solving this problem gives us a higher reward over time in situations where the globally best arm isn’t always the best arm. Example algorithm: Thompson Sampling with Linear Payoffs [3] [3]: https://arxiv.org/abs/1209.3352
  • 33. …ACTUALLY, ADVERSARIAL CONTEXTUAL BANDITS ARE THE HOLY GRAIL Until now, we’ve assumed that each one-armed bandit gives a $100 reward according to some unknown probability P. In real-world scenarios, the world rarely behaves this well. Instead of a simple dice roll, the bandit may pay out differently depending on the day/hour/amount of money in the machine. It works as an adversary of sorts. A bandit algorithm that is capable of dealing with changes in payoff structures in a reasonable amount of time tend to work better than stochastic bandits in real-world settings. Example algorithm: EXP4 (a.k.a the “Monster” algorithm) [4] [4]: https://arxiv.org/abs/1002.4058
  • 34. CONTEXTUAL BANDIT ALGORITHMS ARE 1) STATE-OF- THE-ART & 2) COMPLEX • Many algorithms are <5 years old. Some of the most interesting ones are less than a year old. • Be prepared to read lots of academic papers and struggle implementing the algorithms. • Don’t hesitate to contact the authors if there is some detail you don’t understand (thanks John Langford and Shipra Agrawal!) • Always remember to simulate and validate bandits using real data.
  • 37. BIVARIATE & MULTIVARIATE TESTING Vanilla MAB
  • 42. … & COUNTLESS OTHER POSSIBILITIES
  • 43. TIP: CONTEXTUAL BANDIT IMPLEMENTED IN PYTHON + LAMBDA + API GATEWAY + REDIS = OPTIMISATION ENGINE
  • 45. LAUNCHED YESTERDAY (!): AZURE CUSTOM DECISION SERVICE
  • 46. IF YOU CAN MODEL IT AS A GAME, YOU CAN USE A BANDIT ALGORITHM TO SOLVE IT*. *Given rewards that aren’t delayed.