Logistic Regression Calculator

Logistic Regression Calculator

p = 1 / (1 + e−(β0 + β1x))
Intercept β0
Coefficient β1
Odds ratio eβ1
Accuracy
Pseudo R² (McFadden)
Decision boundary x
20 points loaded (hours studied vs exam pass). Press Fit logistic model.

This free logistic regression calculator fits a logistic model to your data, returns the coefficients, odds ratio, accuracy and decision boundary, and plots the fitted S-curve — so you can see exactly how the probability of a yes/no outcome changes with your predictor.

How to use the logistic regression calculator

  1. Enter your predictor ($x$) values — any numeric variable such as hours studied, age, or dose.
  2. Enter the outcome ($y$) as 0 or 1 (fail/pass, no/yes), one label per $x$ value.
  3. Press “Fit logistic model” to estimate the coefficients and draw the probability curve.
  4. Type any $x$ in the predict box to get the probability and predicted class for a new case.

What the logistic regression calculator computes

Logistic regression models the probability of the outcome with the sigmoid function:

$$p = \frac{1}{1 + e^{-(\beta_0 + \beta_1 x)}}$$

The calculator estimates $\beta_0$ and $\beta_1$ by maximum likelihood (using gradient descent), then reports:

OutputMeaning
Intercept $\beta_0$Log-odds of the outcome when $x = 0$.
Coefficient $\beta_1$Change in log-odds per one-unit increase in $x$.
Odds ratio $e^{\beta_1}$How the odds multiply for each one-unit rise in $x$.
AccuracyShare of points classified correctly at the 0.5 threshold.
Pseudo $R^2$McFadden’s fit measure — higher means a better fit.
Decision boundaryThe $x$ where $p = 0.5$ (the model flips its prediction).
📊 Reading the odds ratioIf the odds ratio is 1.5, the odds of the outcome are 50% higher for every one-unit increase in $x$. An odds ratio of 1 means $x$ has no effect; below 1 means $x$ lowers the odds.

Worked example: hours studied vs passing

The built-in example is the classic study-hours dataset: 20 students, their hours of study ($x$), and whether they passed ($y = 1$) or failed ($y = 0$). Fitting it gives roughly $\beta_0 \approx -4.08$ and $\beta_1 \approx 1.50$, so each extra hour multiplies the odds of passing by about $e^{1.5} \approx 4.5$, and the 50% decision boundary lands near 2.7 hours. Study less and you are more likely to fail; study more and the curve climbs toward a near-certain pass.

🤖 Why logistic regression matters in ML

Logistic regression is the simplest classification model and the building block of neural networks — a single neuron with a sigmoid activation. It is supervised learning; see supervised vs unsupervised vs reinforcement learning. To understand how it differs from fitting a straight line, read logistic regression vs linear regression, or fit continuous data with the linear regression calculator.

Assumptions to keep in mind

  • The outcome is binary (exactly two classes).
  • The log-odds are linearly related to the predictor.
  • Observations are independent.
  • There is enough data in both classes — this tool needs at least one 0 and one 1.

Frequently asked questions

What does a logistic regression calculator do?
It fits a logistic (sigmoid) model to your x and 0/1 data using maximum likelihood, then reports the coefficients, odds ratio, accuracy, pseudo R-squared and decision boundary, and plots the probability curve.
What data do I need?
A numeric predictor x and a binary outcome y coded as 0 or 1, with the same number of values in each box and at least one example of each class.
How is the coefficient interpreted?
The coefficient is the change in log-odds per unit of x. Exponentiating it gives the odds ratio, which is how the odds of the outcome multiply for each one-unit increase in x.
What is the decision boundary?
It is the x value where the predicted probability equals 0.5. Below it the model predicts class 0; above it, class 1.
Is this multiple or simple logistic regression?
This calculator fits simple (one-predictor) logistic regression so you can see the curve. The same maximum-likelihood method extends to multiple predictors.

Key takeaways

A logistic regression calculator turns raw 0/1 data into a fitted probability curve, coefficients and an odds ratio in one click. Use it to model any yes/no outcome, read the decision boundary, and predict the probability for new inputs. Pair it with the logistic vs linear regression guide or the formal reference on Wikipedia.

Scroll to Top