Interactive Logistic Regression

Binary classifier with decision boundary σ(w·x + b), where σ is the sigmoid. Click the chart to add points; toggle class with the switch.


Dataset & Decision Boundary
Class 1 Class 0 Decision boundary: w₀·x + w₁·y + b = 0
x=—, y=—, z=—, p=—
ROC Curve
Each point = threshold. Diagonal = random (AUC 0.5)
Precision–Recall Curve
PR is more informative on imbalanced data
What's happening in this demo?

This demo shows logistic regression learning a decision boundary to separate two classes. The model learns weights w₀, w₁ and bias b such that the decision boundary is the line w₀·x + w₁·y + b = 0.

Click the plot to add training points. Use the sliders to manually adjust the boundary, or click "Train" to let gradient descent find the optimal weights automatically.

The sigmoid function converts the linear combination to a probability: p = 1/(1 + e^(-(w₀·x + w₁·y + b))). Points are classified as class 1 if p > τ (threshold).

Controls
Metrics
Log loss
ΔLoss
Accuracy
Steps
0
N points
0
Confusion Matrix (@ τ)
Pred 0Pred 1
Actual 0
Actual 1
TN=True Neg, FP=False Pos, FN=False Neg, TP=True Pos

Support This Free Tool

Every coffee helps keep the servers running. Every book sale funds the next tool I'm dreaming up. You're not just supporting a site — you're helping me build what developers actually need.

500K+ users
200+ tools
100% private
Privacy Guarantee: Private keys you enter or generate are never stored on our servers. All tools are served over HTTPS.

About This Tool & Methodology

This module fits logistic regression for binary outcomes using maximum likelihood with optional regularization. It visualizes decision boundaries, probability surfaces, and key metrics (log‑loss, accuracy, ROC/AUC) based on synthetic or provided data.

Learning Outcomes

  • Relate coefficients to log‑odds and probability.
  • See effects of regularization (L2) on boundary and variance.
  • Understand thresholding, ROC/AUC, and calibration basics.

Authorship & Review

  • Author: 8gwifi.org engineering team
  • Reviewed by: Anish Nath
  • Last updated: 2025-11-19

Trust & Privacy

  • Runs locally in your browser; sample data is generated client‑side.