ML Day 4 - moving from Linear to Logistic Regression!!
this is what ive learnt:
still building on linear regression
I thought logistic regression was just “linear regression, but for classification.” Turns out I was missing a pretty important detail.
v good example which helped me understand better:
Say you’re building a spam detector.
A linear regression model might happily predict:
1.7 → spam
-0.4 → not spam
The math works.
The answers don’t.
Because unlike predicting house prices or temperatures, classification isn’t asking us “what number?” righttt!
It’s asking:
“How confident are you that this belongs to class A?”
That confidence has to be between 0 and 1.
That’s where the sigmoid finally made sense to me.
It takes any real number…
-100
0
5
1000
…and squishes it into a value strictly between 0 and 1.
The coolest part?
It never actually reaches 0 or 1.
It gets ridiculously close, but never all the way there.
Which basically means the model is never saying,
“I’m infinitely certain.” There’s always some uncertainty left.
That felt surprisingly elegant to me :)
Also made me realize logistic regression isn’t really replacing linear regression..
It’s taking the same linear equation…
z = wx + b
…and asking a completely different question.
Instead of: What’s the output?
it’s asking: Given this score, what’s the probability this belongs to class 1?
that tiny shift changes everything.
if I’ve oversimplified anything, please call it out. I’d genuinely love corrections from people who’ve worked with ML longer than I have.