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

Our first test

Let's start with an example of what a test looks like in Python. We will be using nosetests throughout this book. The main reason for using this is that while it is a bit of a pain to install a library, this library in particular will make everything that we do much simpler. The default unit test solution in Python requires a heavier set up. On top of this, by using nose, we can always mix in tests that use the built-in solution when we find that we need the extra features.

First, install it like this:

pip install nose

If you have never used pip before then it is time for you to know that it is a very simple way to install new Python libraries.

Now, as a hello world style example, let's pretend that we're building a class that will ...

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