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

Testing with simulation

A recurring theme in this book is to use what's known as Monte Carlo methods to quantify the quality of our algorithm. Using this technique, we will time and again create groups of random data to see how well our algorithms (ignorant of how we created the data) perform at detecting the differences. In the previous chapter, most of the tests that we developed had deterministic test cases. In this chapter, the test cases will be specified by the parameters that we use, but all of the data that we create will be random.

First things first, we need to develop a small framework that we can use to run our simulations. In order to do this, we should more clearly articulate our scenario. Here's a more thorough definition.

Imagine ...

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