
Previously, in our first episode of Supervised Learningβs Got Talent, we were introduced to our debut performer, Linear Regression.
Linear Regression is the impressively correct oversimplifier. Today, however, we take a look at Mr. Linearβs quirky cousin. (Yes, theyβre relatives!)
Introducing, Logistic Regression!

Logistic Regression: The Probability Bouncer. He either lets you in or out.
This guyβs specialty isnβt with drawing lines like Linear Regression, but heβs really good at making decisions.
Letβs get into it.

π Logistic Regression - βThe Probability Bouncerβ
Now despite having βRegressionβ in its name (itβs a bit of a mathematical inside joke, really), this algorithm is actually a master of classification.
Specifically, heβs good at deciding Yes or No on something. Gotta appreciate that type of straightforwardness.
Logistic Regression isnβt trying to predict a continuous number like Linear Regression. Instead, itβs the ultimate yes/no or (0/1) question asker.
Can you think of someone you know whoβs good at making decisions? Perhaps theyβre good at answering questions like:
βWill this email be spam?β
βShould I post this selfie?β
βIs The Gradient Descent awesome?β (hint: YES).
Well, if you could magically transform that person into an ML algorithm theyβd turn into Logistic Regression.

π€ The Sigmoid Function
Logistic Regression works its magic by drawing an S-shaped curve instead of a straight line. This is called the Sigmoid Function.
For example, imagine weβre trying to decide if someone is on diet based on how many donuts they eat per day.
When that person eats fewer donuts, the chance of a diet is high. If they eat lots of donuts, that chance drop precipitously.
The Sigmoid Function to make that decision would look something like this:

Donuts vs Discipline: An Epic Battle.
Notice how those purple xβs are either on 0 or 1? Thatβs basically saying, yes this person is on a diet and deserves a pat on the back (0), or no this personβs not on a diet and deserves a pat on the stomach (1).
The smooth orange S-shaped curve is the sigmoid curve. See how it starts to curve upwards as more donuts are eaten? Thatβs basically showing the increasing probability that this person is not dieting.
Threshold
So how does Logistic Regression actually make the decision to say βyesβ or βnoβ to something? It uses the Threshold.
The threshold is the cutoff point we set to decide when a probability flips from βNoβ to βYesβ.
By default (as you can see in the graph above), the threshold is usually 0.5:
If the modelβs prediction is greater than or equal to 0.5, we say βYesβ.
If the modelβs prediction is less than 0.5, we say βNoβ.
This is where the βSβ formation comes from; the line starts to curve up as the threshold gets closer to 1.
The cool part? You can change the threshold depending on your problem. For example, you may want to lower the threshold to catch more spam emails, or for medical tests, you might raise it to be extra sure before saying someone has a disease.

π§ The Math Of Sigmoid Function
With a name like βSigmoid Functionβ, of course there has to be math involved right? Donβt worry, the equation looks friendly. Letβs break it down:

The Sigmoid: Squishing inputs into a nice 'maybe'!
Ο(x) (sigma of x): This is the output of the function, and it will always be a value between 0 and 1. This is your probability!
e: This is Euler's number, an important mathematical constant, approximately 2.71828. It's the base of the natural logarithm.
x: This means you take your input value x and make it negative.
π When x is big β Ο(x) gets close to 1 (a strong βYESβ).
π When x is small (or negative) β Ο(x) drops close to 0 (a strong βNOβ).
π When x is around zero β Ο(x) hovers near 50% (it could go either way).
Think of the sigmoid like a soft yes/no switch - not a hard cutoff. It smoothly shifts from βprobably noβ to βprobably yesβ as the input changes.

π¨βπ» Coding Exercise + Practice Quiz + Visual PDF
Time to go from regression to progression with actual practice.
π§ͺ Interactive Google Colab: See machine learning concepts in action with a simple hands-on demo using real data. Watch how models learn, improve, and sometimes completely overthink things. No experience needed β just hit run and explore.
π Practice Quiz: 3 levels. 10 questions each. Easy covers the core concepts. Medium starts connecting ideas. Hard dives into the trickier topics that make even experienced people pause and go, βwaitβ¦ hold on.β
π Visual Cheatsheet: A clean visual guide to the key concepts from todayβs lesson β organized, color-coded, and designed to be the reference you actually come back to when your brain decides to factory reset mid-study session.
Alright, you made it this farβ¦ respect π€
Want to unlock the rest? Join the Pro Tier and get the good stuff. In other words, the stuff I didn't gatekeep. π This paid tier is brand new, which means you have a chance to be one of the first people in.
UpgradeWhat you unlock:
- β‘ Founding Member Deal: First 100 subscribers lock in $5/month for life. After that, it's $9.99/month
- Cheat Sheets / Visual Guides (Weekly)
- 10-Question Quiz (Easy / Medium / Hard) + Solutions (Weekly)
- Hands-On Notebook: Google Colab Link + Jupyter Notebook For Coding Implementation (Weekly)
- Discount Codes For All E-Books
