AI in Motion

Machine LearningBeginner1:29 video6 chapters

Linear Classifiers: Logistic Regression and the Perceptron — lecture notes

Draw a line that separates two classes. Watch logistic regression learn a probabilistic boundary and the perceptron nudge its line towards mistakes.

▶ Watch the animated lecture

0:001. Introduction

Introduction — Linear Classifiers: Logistic Regression and the Perceptron

Classification means predicting a category: spam or not, pass or fail. The simplest classifiers separate the classes with a straight line.

0:092. Logistic regression

Logistic regression — Linear Classifiers: Logistic Regression and the Perceptron

Logistic regression learns a boundary and a probability for every point. The background shading shows how confident it is. Watch the boundary move as training runs. Accuracy climbs from 59 percent to 93 percent, with a few overlapping points still misclassified.

0:273. The sigmoid

The sigmoid — Linear Classifiers: Logistic Regression and the Perceptron

The model computes a linear score, like linear regression, and passes it through the sigmoid, which squeezes any number into a probability between zero and one. Above one half, we predict the positive class.

0:424. The perceptron

The perceptron — Linear Classifiers: Logistic Regression and the Perceptron

The perceptron, from 1958, is even simpler. It looks at a training point. If the point is on the wrong side, it nudges the line towards it. If it is correct, it does nothing. Repeat, and the line settles into a good position.

1:005. Comparison

Comparison — Linear Classifiers: Logistic Regression and the Perceptron

Logistic regression gives probabilities and trains smoothly. The perceptron only outputs a class and only learns from mistakes. But it is historically important: it is the ancestor of every neural network.

1:146. Recap

Recap — Linear Classifiers: Logistic Regression and the Perceptron

To recap. Linear classifiers draw a straight boundary. Logistic regression outputs probabilities. The perceptron learns from mistakes. And neither can handle problems that need a curved boundary, which is where more powerful models come in.

Key takeaways

  • Linear classifiers separate classes with a straight line (or plane).
  • Logistic regression applies the sigmoid to a linear score to get a probability.
  • The perceptron updates only when it misclassifies a point.
  • In the animation both reach 41 of 44 points correct (93%).

Check yourself

  1. What does the sigmoid function do?
    Show answer

    Squeezes any number into the range 0–1 — Sigmoid outputs can be read as probabilities.

  2. When does the perceptron change its line?
    Show answer

    Only when a point is misclassified — It learns only from mistakes.

  3. What is a limitation of both models?
    Show answer

    They can only draw straight boundaries — Linear models cannot represent curved boundaries without extra features.

Go deeper

© 2026 Janin A Apurba, CSE, AUST · Advanced ICT Officer, CNRS-UNHCR. All rights reserved. Notes for the animated lecture at https://ai-in-motion.vercel.app/watch/logistic-regression-and-the-perceptron.html