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 ...

Get Test-Driven Machine Learning now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.