Logistic Regression

Logistic regression bends a straight line into an S-curve to answer yes-or-no questions with probabilities.

Build 1.5 hr Python

Prerequisites: Phase 2 Lesson 1-2 (What Is ML, Linear Regression)

#Learning Objectives

  • Implement logistic regression from scratch using the sigmoid function and binary cross-entropy loss
  • Compute and interpret precision, recall, F1 score, and the confusion matrix for binary classification
  • Explain why MSE fails for classification and why binary cross-entropy produces a convex cost surface
  • Build a softmax regression model for multi-class classification and evaluate threshold tuning tradeoffs
Full Access lesson

Keep going. The rest of this lesson is one step away.

Unlock all 503 lessons, video, code, quizzes and every future update. Pay in your own currency with Paystack.

The text and code of this lesson are based on AI Engineering from Scratch by Rohit Ghumare, MIT licensed.