O'Reilly logo

Test-Driven Machine Learning by Justin Bozonier

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Simulating real world situations

What I'd like to do now is take a detour to see what the performance of this algorithm looks like over time. We won't be test driving the simulation harness that I will use here. We will instead use this as an opportunity to visually identify the performance characteristics of two separate multi-armed bandit algorithms. Let's start introducing the different concepts from the code. The following code sets up our experimental world to be simulated. I'll instantiate BanditScenario and set up treatments A-C to have certain parameters that will provide guidance on how well each does in our experiment:

simulated_experiment = BanditScenario({ 'A': { 'conversion_rate': .05, 'order_average': 35.00 }, 'B':{ 'conversion_rate': ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required