From Animation to Intuition

Visualizing Optimization in Linear Regression and Logistic Regression

Logan Yang
The Startup
8 min readApr 18, 2020

--

This is one post in a series for machine learning optimization animations. Each plot can serve as a flashcard for easy consumption.

Long Island, Spring 2019
Flying over Town Beach near the tip of Long Island, Spring 2019. Picture taken by me with DJI Mavic Air.

If you are like me, you may prefer looking at pictures that move to pages of Greek symbols when it comes to learning math. It’s more intuitive, more fun, and a great way to look under the hood and debug if things go wrong. So here I’m not going to bore you with equations. Equations and long derivations are important, but you already have countless books and notes for them.

I believe animation is the best way to learn, review and internalize math for both beginners and long-term practitioners. One of my favorite people in this area is Grant Anderson or 3Blue1Brown on Youtube. I highly recommend his videos on linear algebra and backpropagation.

In this post, I will show a few animations that visualize “learning in action”. Hopefully, they can convey the “feel” of some foundational machine learning concepts in the most basic form. It’s helpful to replay these scenes once in a while in your head to get a better “feel”.

Linear Regression

Say, we have some 2-dimensional data and we would like to use a straight line to…

--

--

Logan Yang
The Startup

Engineer, builder, writer. Follow me here and on Twitter for future content https://twitter.com/logancyang