All lessons in Machine Learning Engineering: Reliable Predictive Models
Logistic Regression and Log Loss
Turn a linear score into a probability and calculate the cost of confident mistakes.
30 minutes · Free with an account · preview
What you will learn
- Convert a linear score into a late-delivery probability with the logistic function and interpret a weight as a change in log odds.
- Compute log loss for individual parcels and for a validation set, and explain why one confident wrong prediction can outweigh several cautious ones.
- Derive the gradient of log loss with respect to the linear score and apply one gradient step by hand.
At dispatch the carrier does not need a minute estimate; it needs a probability that a parcel will miss its window, so that re-routing capacity can be spent where it matters. Logistic regression is the simplest model that produces such a probability from the same linear score used in the previous lesson, and log loss is the scoring rule that holds those probabilities to account. This lesson builds both by hand, because the workbook selects its final model by validation log loss and you should know exactly what that number punishes.