Logistic Regression

Logistic regression is an algorithm for binary classification. Logistic regression transforms its output using the sigmoid function to return a probability value between 0 and 1.

Example of binary classification:

Recognize above image 1 or 0 (non cat)

To turn these pixel intensity values into a feature vector, what we’re going to do is unroll all of these pixel values into an input feature vector x.

If this image is a 64 by 64 image, the total dimension of this vector x will be 64 by 64 by 3 because that’s the total numbers we have in all of these matrixes. Which in this case, turns out to be 12,288, that’s what you get if you multiply all those numbers. And so we’re going to use nx=12288 to represent the dimension of the input features x.

Notations

Training example:

Training Set:

Logistic regression

Notation:

Sigmoid function can be written as

is and the rest are