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

Chapter 7. Optimizing by Choosing a New Algorithm

In this chapter, we'll dig into the heart of the problem that we have been preparing to solve—predicting which gender someone is from their height, weight, and BMI. We have built a N-class Gaussian Naïve Bayes classifier, but it only works on one dimension. This problem will require one addition of making our classifier support three dimensions. It may be tempting to modify it to support an arbitrary number of dimensions, but right now there wouldn't be any value to it. What's more, hard coding our class to work for three-dimensional input may help us save some time.

After this, we'll replace our custom classifier with a Random Forest classifier from scikit-learn. From there, we'll compare performance ...

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