logistic regression calculator

Logistic Regression Probability Calculator

Enter model coefficients and predictor values to compute a predicted probability and binary class.

Formula: z = β0 + β1x1 + β2x2 + β3x3
p = 1 / (1 + e-z)

Model Coefficients (β)

Predictor Values (x)

Tip: leave unused predictors at 0 if your model has fewer than 3 features.

Logistic regression is a core method in statistics, machine learning, risk scoring, and medical decision support. It estimates the probability of a binary outcome, such as yes/no, default/no default, or disease/no disease. This calculator lets you quickly convert coefficients and feature values into an interpretable probability and class prediction.

What this calculator helps you do

  • Compute the linear score (log-odds) for a new observation.
  • Transform that score into a probability using the sigmoid function.
  • Apply a threshold to classify the result as class 0 or class 1.
  • Inspect how each feature contributes to the final score.

How logistic regression works

1) Build the linear predictor

You first calculate a weighted sum of inputs:

z = β0 + β1x1 + β2x2 + β3x3

Each coefficient (β) controls the direction and strength of a feature’s influence. Positive coefficients increase the score, negative coefficients decrease it.

2) Convert score to probability

The score z is mapped to a probability between 0 and 1:

p = 1 / (1 + e-z)

This nonlinear step is why logistic regression outputs probabilities rather than unbounded values.

3) Choose a threshold

A threshold (commonly 0.50) turns probability into a class label:

  • If p ≥ threshold, predict class 1.
  • If p < threshold, predict class 0.

How to use this logistic regression calculator

  • Enter intercept and coefficient values from your trained model.
  • Enter feature values for the observation you want to score.
  • Set a threshold based on your use case (risk tolerance, recall target, etc.).
  • Click Calculate to view probability, odds, and predicted class.

Worked example

Click Load Example to prefill a sample model. In that scenario, the calculator estimates the probability of an event using three predictors. You will see the linear score, probability percentage, and final class decision at threshold 0.50. This is useful for learning and for sanity-checking manual calculations.

Interpreting coefficients

Sign matters

  • Positive β: higher feature value increases event probability.
  • Negative β: higher feature value decreases event probability.

Magnitude matters

Larger absolute coefficient values typically indicate stronger influence on the log-odds scale, assuming features are on comparable scales.

Odds ratio interpretation

The odds ratio for a one-unit increase in a feature is eβ. For example, β = 0.69 corresponds to roughly doubling the odds (e^0.69 ≈ 2.0).

Choosing the right threshold

Threshold selection should be business- or domain-driven:

  • Higher threshold: fewer positive predictions, usually higher precision.
  • Lower threshold: more positive predictions, usually higher recall.
  • In medical screening, lower thresholds may be preferred to reduce missed cases.
  • In fraud controls, threshold tuning can balance false positives vs. missed fraud.

Model quality metrics to use with this calculator

Accuracy

Good for balanced datasets, but can mislead when classes are highly imbalanced.

Precision and recall

Precision tells you how many predicted positives are correct; recall tells you how many true positives were captured.

ROC-AUC

Measures ranking quality across thresholds and is often reported in model validation.

Calibration

If probabilities are used for decisions, calibration quality is critical. A well-calibrated model outputs probabilities that reflect real frequencies.

Common mistakes to avoid

  • Using coefficients from differently scaled features without applying the same preprocessing.
  • Interpreting coefficients causally without proper study design.
  • Assuming 0.50 is always the best threshold.
  • Forgetting that this calculator scores a model; it does not train one.

Final thoughts

A logistic regression calculator is a fast way to operationalize model outputs and communicate risk clearly. Use it for quick predictions, threshold tuning discussions, and teaching the mechanics of probability estimation. For production use, pair these calculations with robust validation, calibration checks, and domain-specific decision policies.

🔗 Related Calculators