Logistic Regression

Classification and Representation

Classification

Hypothesis Representation

Decision Boundary


Example:

Logistic Regression Model

Cost Function

We cannot use the same cost function that we use for linear regression because the Logistic Function will cause the output to be wavy, causing many local optima. In other words, it will be a non-convex function.


Logistic Regression Cost Function:

Simplified Cost Function & Gradient Descent

We can compress our cost function’s two conditional cases into one case:

Cost(hθ(x), y) = -ylog(hθ(x)) - (1-y)log(1-hθ(x))

Notes:

Advanced Optimization

How to use:

Concept:

Multiclass Classification

Now we will approach the classification of data when we have more than two categories. Instead of y = {0,1} we will expand our definition so that y = {0,1…n}.

One-vs-All Approach:



← Previous: Octave/Matlab Tutorial

Next: Regularization →