Introduction
Training a logistic regression model means finding weights θ that give high probabilities to positive examples and low probabilities to negative examples. To do that, we need a cost function that measures how good or bad the probabilities are.
We can't reuse MSE — for logistic regression it creates a bumpy cost surface that's hard to optimise, and it doesn't punish confident mistakes strongly enough. Instead we use the log loss (also called binary cross-entropy). It's the cost function behind logistic regression and the output layer of countless neural networks.