Logistic Regression, Part 1: From a Line to a Probability
Harban AI LABS
0:00 / 0:00
Logistic Regression, Part 1: From a Line to a Probability
14 просмотров · 9 дней назад
Harban AI LABS
43 подписчика
14 просмотров · 9 дней назад
Logistic regression explained, part 1: from a straight line to a probability with the sigmoid function, for binary classification.
Will this student pass: yes or no? A regression line answers "1.55", which is neither a yes nor a probability. In part one of logistic regression we see why a straight regression line is the wrong tool for a yes or no question, we draw a line that separates two classes, we find one with a simple nudging rule, and then we meet the sigmoid: the curve that turns the distance from that line into a probability.
You will learn:
Classification with two classes, written as 0 and 1
Why a regression line is a poor classifier: outputs below 0 and above 1, and one far point drags the cut (4.5 → 5.3 hours)
The decision boundary w1·x1 + w2·x2 + b = 0, the score z, and its positive and negative side
The perceptron rule: nudge the line towards a misclassified point; a real run that ends after five nudges
Its two weaknesses: it stops at the first line with no mistakes, and it has no notion of confidence
The sigmoid 1 / (1 + e^(−z)), built point by point: 0.02, 0.12, 0.5, 0.88, 0.98
How distance from the boundary becomes a probability, and why it is 0.5 on the boundary
Reading a prediction as a probability, and choosing a threshold (0.3, 0.5, 0.8)
Part two covers how the model is trained.
Chapters
0:00 A yes or no question
0:36 Why a regression line is a poor classifier
2:11 The decision boundary and the score z
2:57 Nudging the line: the perceptron rule
3:47 Its two weaknesses
4:14 The sigmoid, built point by point
5:09 From distance to probability
5:44 Reading a prediction, choosing a threshold
6:18 Recap + try it yourself
Try it yourself: compute the sigmoid of 2 (hint: e^(−2) ≈ 0.135) and the sigmoid of −2 (hint: e^2 ≈ 7.39). Add the two answers. What do you notice?
Animations made with Manim Community Edition. The narration is a synthetic voice. All data in this video are simulated.
#LogisticRegression #MachineLearning #AIEngineer
More from Harban AI Labs: https://harban-ai-labs.vercel.app/