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

Gaussian classification by hand


Since the Gaussian Naïve Bayes classifier is less common, let's discuss it a bit more before diving in. The Gaussian Naïve Bayes algorithm works by taking in values that are continuous, and by assuming that they are all independent and that each variable follows a Gaussian (or Normal) distribution. It may not be obvious how a probability follows from this, so let's look at a concrete example.

Let's say that I give you five weights from the female test subjects and five weights from the male test subjects. Next, I want to give you a weight from a test subject of an unknown gender, and have you guess whether it's a man or woman. Using a Gaussian classifier, we can approach this problem by first defining an underlying Gaussian model for both, female and male observations (two models in total). A Gaussian model is specified using a mean and variance. Let's step through this with some numbers.

Let's assume that the following data is provided:

  • The weight of five random...