Logistic Regression and Cross-Entropy
This lesson answers two questions about logistic regression: "derive the gradient of the loss" and "why not use squared error for classification?" Both have short, exact answers. The lesson then covers what goes wrong when the model is used on returns.
The model
Logistic regression models the probability that a binary label is 1. This lesson writes the weights as and the intercept as , where the regression lessons write :
Taking the inverse of shows what is linear: the log-odds,
A one-unit increase in adds to the log-odds, so it multiplies the odds by . It is not a fixed change in probability, which depends on where starts.
The rest of this lesson is for subscribers
Unlock every lesson in Machine Learning for Quantitative Research, and every other premium course.
Subscribe to continueTest your knowledge
Keep reading Machine Learning for Quantitative Research
27 lessons in this course, and every other premium course, on one subscription.
- Every lesson in every course, with the worked examples and interactive simulators
- Graded questions on every lesson, with explanations for the wrong answers as well as the right one
- The trainers, timed assessments and brainteaser library that go with them