Logistic Regression: Cost Function
We cannot use the same cost function that we use for linear regression because the Logistic (Sigmoid) Function will cause the output to be wavy, causing many local optima. In other words, it will not be a convex function.
Instead, our cost function for logistic regression looks like:
Note that writing the cost function in this way guarantees that is convex for logistic regression.
actually gives us the cost for a particular training example at a particular . Plotting w.r.t. gives: