Interactive comparison of the two fundamental regression techniques
Predicts a continuous value using a best-fit line.
Formula: y = β₀ + β₁x
Example: Predicting house price based on square footage.
Predicts a probability (0–1) using a sigmoid curve.
Formula: p = 1 / (1 + e-(β₀+β₁x))
Example: Predicting pass/fail based on study hours.
| Aspect | Linear Regression | Logistic Regression |
|---|---|---|
| Purpose | Predict continuous numerical values | Classify into discrete categories |
| Output Range | −∞ to +∞ | 0 to 1 (probability) |
| Curve Shape | Straight line | S-shaped (sigmoid) curve |
| Loss Function | Mean Squared Error (MSE) | Binary Cross-Entropy (Log Loss) |
| Metrics | R², RMSE, MAE | Accuracy, Precision, Recall, AUC-ROC |
| Example | House price, temperature, sales forecast | Spam detection, disease diagnosis, pass/fail |