A class of 100 students takes an exam. At the end of the exam, the students self-report the number of hours they studied 📚 for the exam and the amount of sleep 😴 they got the night before. Here's what the data looks like including the Pass/Fail exam results.

Notice the striking similarity between the Perceptron and Logistic Regression. The only difference is, the Perceptron uses the Heaviside step function to squash its input into the discrete set {0, 1} whereas Logistic Regression uses the expit function to squash its input into the continuous range (0,1).

This effect of this is, Logistic Regression is differentiable and the Perceptron is not! Therefore, logistic regression can be trained with gradient descent while the Perceptron relies on other learning algorithms.