### Algorithm: Gaussian Naive Bayes

Recall from my Naive Bayes post that there are several variants. One of the variants that I'll be talking about today is Gaussian Naive Bayes.

### Probability Distributions and Random Variables

Suppose I had two coins and I flipped both of them. The possible combinations can be two heads, two tails, or one of each. These combinations are all part of a *sample space*.

Now let's take this a step further. Taking the above demonstration, we want to determine the probability that each combination would occur.

Assuming independence, we derive the following probabilities:

All of these probabilities belong in a *probability distribution*.

### Deriving the Cost Function for Logistic Regression

In my previous post, you saw the derivative of the cost function for logistic regression as:

I bet several of you were thinking, "How on Earth could you derive a cost function like this:

Into a nice function like this:

?"

Well, this post is going to go through the math. Even if you already know it, it's a good algebra and calculus problem. Read more