Module lessons (1/6)
Logistic regression
The sigmoid, probabilities, thresholds and linear decision boundaries.
What you'll learn in this lesson
- Explain how logistic regression turns a score into a probability with the sigmoid.
- Train a classifier, read its probabilities and change the decision threshold.
- Describe the decision boundary of a linear classifier.
Overview
Linear regression outputs any number. For classification we want a probability between 0 and 1: "how likely is this tumour to be malignant?". Logistic regression computes a linear score exactly as before and then squeezes it through the sigmoid function:
Large positive scores give probabilities near 1, large negative scores near 0, and a score of 0 gives exactly 0.5. To get a class, we compare the probability with a threshold, 0.5 by default.
Sections covered in this lesson
- 1The hook: from a number to a probability
- 2Try it: boundary lab
- 3Linear regression vs. logistic regression
- 4Progressive examples: from logits to thresholds
- 5Practice
- 6Check your understanding
Unlock "Logistic regression" and the full Machine Learning: from first principles to practice curriculum
The sigmoid, probabilities, thresholds and linear decision boundaries.
Unlock all 5 hands-on exercises in this lesson plus every advanced WebAssembly module with automated checks.
- Instant access to all advanced modules in Machine Learning: from first principles to practice plus 17 more courses
- Hands-on browser exercises with automated test suites and solutions
- 14-day money-back guarantee processed via Paddle.com
14-day guarantee · Cancel anytimeModule 1, all 18 interactive games, and cheatsheets are always free.