Logistic Regression

Binary classification with gradient descent optimization

Speed:

Synthetic Datasets

Real-World Examples

Hyperparameters

1 (Line)2 (Curve)3 (Complex)

Legend

Class 0 (Blue)
Class 1 (Red)
Decision Boundary (Line)
Correct Prediction
Incorrect Prediction

Sigmoid Function

Maps any input z to probability [0, 1]

Output = 0.5 when z = 0

Dataset Info

Diabetes Risk: Age vs Glucose

Fraud Detection: Time vs Amount

Exam Pass/Fail: Study Hours vs Score

XOR Pattern: Requires degree ≥ 2

About

Sigmoid: σ(z) = 1 / (1 + e^(-z))

Cost: Binary Cross-Entropy

Optimization: Gradient Descent

Decision Boundary:

• Degree 1: Straight line

• Degree 2+: Curved boundary

Complexity: O(n × d² × iter)

where d = polynomial degree