Summer of Math Exposition

Presented by 3Blue1Brown 3blue1brown

Logistic Regression (and why it's different from Linear Regression)

Audience:

Gentle Introduction to Logistic Regression. We explore this powerful yet simple machine learning model for binary classification tasks like predicting whether a student will pass or fail an exam! We’ll explain the difference between logistic and linear regression, dive into the intuition behind the sigmoid function, and uncover why cross-entropy loss makes sense for probability-based models. No complex math needed—just clear explanations, intuitive visuals, and a practical demo in Python with scikit-learn.


Analytics

6.5 Overall score*
54 Rank
19 Votes
9 Comments

Comments

5.5

I think this video has some great editting, animations, and is well-delivered. Unfortunately, though, I think the script and level of detail could be much improved. From a mathematical perspective, I feel as if this video was very lacking; there are no details given to the properties of the logistic function, and why that could be used over, say, log-normal or the like. Providing practical code at the end is very nice, but I just wish there were more to the video than showing the viewer than logistic regression exists.

8.8

loved it and all of your other videos. simply amazing.

7.7

Really good video! One thing though, if you start at the beginning with an example of a cat and a dog picture, it would be nice to revisit this again later.

6

Very clean and concise!

6.3

You did great on establishing clear motivation from the beginning. I appreciated the simplicity for the first half, and there was a nice and steady ramp-up in complexity. I also love the use of Motion Canvas!

However, I never quite understood your argument for choosing cross-entropy over MSE as a loss function (4:15); I don’t think everyone would agree with you on penalizing bad predictions relatively instead of absolutely. The classical argument is that MSE applied to a sigmoid yields a non-convex loss surface which is bad for training on gradient descent, but I think it’s easier to describe cross-entropy as doing a better job of “being more surprised” by bad predictions the more unlikely they get, whereas MSE is pretty much universally surprised by any bad prediction, hence “bad at training.” Also, I didn’t get much value out of the coding section — that seemed more like practical application rather than demonstrating the theory. GENERALLY, I would’ve liked to see more discussion on what training looks like, as I think that would shed more light on some of the haziest parts.

All in all, nice job!

P.S. There are some other questions that might come from someone learning this for the first time (e.g., why not just use linear regression and round the output to 0 or 1?) that go unanswered which might leave some people unsatisfied.

6.5

Nice, focused, easy-to-follow video with helpful accompanying animations.

8.8

That was one of the best ones I voted on. Graphics and audio great. Well motivated and pleasingly concise. Congratulations.

8

The animations are great, and the examples are very clear and helpful. I’m not sure that exam success is the best example (there are many other variables impacting exam scores, and there is no theoretical upper bound on the number of hours studied…) but it won’t impact student understanding.

3.4

The production value was very high and the video was well put together. However, I do not think the cat dog example really highlights logistic regression—most of the work there would be getting the pictures in to numbers usable for logistic regression. I didn’t find the motivation for log odds particularly strong; I’m not sure people share the intuition alleged here. I think giving in an example in sklearn is somewhat trivial since the only aspect substantive to logistic regression is specifying which model to use. Furthermore, logistic regression is not defined by gradient descent, which was mentioned, but then the summary made it seem otherwise.