Logistic Regression
Logistic regression answers yes or no questions. Will this student pass? Is this SMS spam? It gives a chance between 0 and 1, and then you pick a side. In this lesson you build it from scratch with NumPy.
New words
- Classification
- Putting each item into one group, such as pass or fail.
- Sigmoid
- A function that squashes any number into a value between 0 and 1.
- Probability
- A number from 0 to 1 that tells how likely something is.
- Threshold
- The cut-off chance. At or above it, the answer is yes.
- Decision boundary
- The point where the model switches from no to yes.
- Log loss
- A score for the model's mistakes. Confident and wrong costs the most.
What you will learn
- Will Priya pass the exam?
- Why is a straight line wrong?
- What is the sigmoid?
- What is the output, and what is the threshold?
- How does the model know it is wrong? Log loss
- How does the model learn w and b?
- Draw the S-curve with Matplotlib
- Try it: move the S-curve
- Common mistakes
- Explain it to a friend
- Key takeaways
10 quiz questions at the end.
The full lesson, with interactive demos and the quiz, opens after you sign in with Google. It is free.