Book Image

Test Driven Machine Learning

Book Image

Test Driven Machine Learning

Overview of this book

Table of Contents (16 chapters)
Test-Driven Machine Learning
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
2
Perceptively Testing a Perceptron
Index

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 between the two classifiers and choose the one that we think works best.

Later in this chapter, we will be predicting the gender of a patient whose height, weight, and BMI is given. The data is stored in a simple CSV format. Our first step will...