Return to Algorithms

Logistic Regression Visualization

Class 1
Class 0

Controls

Data

Algorithm Parameters

0.001 0.1 0.5

Playback

Slow 1x Fast

Status

Iteration: 0 / 100
Cost: -
Accuracy: -

Visualization Options

Cost Over Iterations

How Logistic Regression Works

Step 1: Start with data points classified into two classes (blue for class 1, red for class 0).

Step 2: Initialize model parameters (weights and bias) that define a decision boundary.

Step 3: Calculate the predicted probability using the sigmoid function: P(y=1) = 1/(1+e^(-z)), where z = w₀ + w₁x₁ + w₂x₂.

Step 4: Compute the cost function (binary cross-entropy loss), which measures the model's performance.

Step 5: Use gradient descent to update the parameters to reduce the cost.

Step 6: Repeat steps 3-5 until convergence or reaching maximum iterations.