Statistics

Logistic Regression Simulator

Classify points in 2D and see how a probability field emerges from the logistic model.

Points: 0Accuracy: 0.00Log-loss: 0.00F1: 0.00Threshold: 0.50Mode: Interactive

Classification plane

Left click = class 0, right click = class 1. Drag to move.

Probability gradient
Export chart

Blue = class 0, orange = class 1. The gradient shows probabilities.

Point generation

Left click adds class 0, right click adds class 1, double click removes.

Live metrics

Model equation z = 0.00 + 0.00x + 0.00y
Accuracy 0.00
Log-loss 0.00
Precision 0.00
Recall 0.00
F1 0.00
Confusion matrix
Pred. 1
Pred. 0
Actual 1
0
0
Actual 0
0
0

Concept bridge: from linear to probability

Show / hide explanation

Step 1 — Linear combination

z = β₀ + β₁x + β₂y. z can take any real value.

z = 0.00

Step 2 — Log-odds

z equals log-odds: log(p / (1-p)).

zOddsp
-40.0180.018
-20.1350.119
01.0000.500
27.3890.881
454.5980.982

Step 3 — Sigmoid

p = 1 / (1 + e⁻ᶻ). The dot shows the probability for a given z.

z = 0.00
Odds: 1.00
p = 0.500

About this tool

When the variable to predict is binary, logistic regression directly models the probability of class membership through the sigmoid function P(y=1∣x)=σ(βTx)=11+e−βTxP(y=1 \mid x) = \sigma(\boldsymbol{\beta}^T x) = \frac{1}{1+e^{-\boldsymbol{\beta}^T x}} which transforms any real value into a probability between 0 and 1. Coefficients are estimated by maximizing the likelihood L(β)=∏i=1nP(yi∣xi)\mathcal{L}(\boldsymbol{\beta}) = \prod_{i=1}^{n} P(y_i \mid x_i) via gradient descent or quasi-Newton methods.

The model learns a linear decision boundary in the space of predictor variables. Coefficients are interpreted in terms of log-odds: a positive coefficient βj\beta_j means that increasing xjx_j by one unit increases the log-odds of belonging to the positive class by βj\beta_j, or equivalently, the odds ratio is multiplied by eβje^{\beta_j}.

This tool visualizes the binary classification process interactively. Modify the training data and model parameters to observe how the decision boundary shifts and how predicted probabilities change. Especially useful for understanding what happens when classes are not linearly separable and how regularization affects model complexity.