Logistic Regression
Data & Curve Fitting
Data Points
+ Pass (y=1)
+ Fail (y=0)
×
Clear All Points
📋 Copy Python Script
Model Parameters
Weight (w)
1.0
Bias (b)
0.0
Show Values
⬇ Forward Pass
Step 1: Linear Term
$$ z = w \cdot x + b $$
↓
Step 2: Sigmoid (Prediction)
$$ \hat{y} = \sigma(z) = \frac{1}{1 + e^{-z}} $$
↓
👁 Loss Calculation (Monitoring)
Step 3: Loss (per point)
$$ L = -[y \ln(\hat{y}) + (1-y) \ln(1-\hat{y})] $$
↓
Step 4: Total Cost
$$ J = \frac{1}{m} \sum_{i=1}^{m} L_i $$
↺ Backward Pass
Step 5: Compute Gradients
$$ \frac{\partial J}{\partial w} = \frac{1}{m} \sum (\hat{y} - y) \cdot x $$ $$ \frac{\partial J}{\partial b} = \frac{1}{m} \sum (\hat{y} - y) $$
(Derived from derivative of Loss function)
↓
Step 6: Update Parameters
$$ w \leftarrow w - \alpha \frac{\partial J}{\partial w} $$ $$ b \leftarrow b - \alpha \frac{\partial J}{\partial b} $$
➔
Repeat to Step 1 with new
w, b
Drag points to move
Double-click point to delete