Inputs
Example data table
This sample shows coefficients, features, and the resulting probability. Use similar structure when validating model outputs.
| Intercept | x1 (β=1.2) | x2 (β=-0.7) | x3 (β=0.4) | z | Probability | Class (t=0.5) |
|---|---|---|---|---|---|---|
| -0.3 | 0.8 | 1.5 | 2.0 | 0.35 | 0.586618 | 1 |
| -0.3 | 0.1 | 2.2 | 0.0 | -1.72 | 0.151872 | 0 |
Formula used
Logistic regression maps a linear score z into a probability:
p = 1 / (1 + e^(−z))
odds = p / (1 − p)
class = 1 if p ≥ threshold else 0
Odds ratios for each predictor are exp(βᵢ), interpreting multiplicative change in odds for a one-unit increase in xᵢ.
How to use this calculator
- Choose Single prediction for one set of feature values, or Batch rows to score multiple rows at once.
- Enter the intercept β₀ and each predictor name with its coefficient βᵢ.
- For single mode, fill feature values xᵢ. For batch mode, add rows in the table matching predictor names.
- Set a threshold to convert probabilities into a predicted class.
- Press Submit. The result appears above the form. Use Download CSV or Print / Save as PDF.
Practical meaning of predicted probability
A logistic model converts a linear score into a probability between 0 and 1, which is useful for ranking risk, prioritizing actions, or triggering workflows. In production, in practice, teams often map probability bands to decisions, such as 0.10–0.30 for monitoring, 0.30–0.70 for review, and above 0.70 for automatic intervention. This calculator exposes the probability alongside its score, making it easier to audit why a case moved into a higher band.
How coefficients shape the score
Each coefficient multiplies its feature value and adds to the score z. A positive coefficient increases z and therefore increases probability; a negative coefficient decreases z and probability. For example, a coefficient of 0.50 adds 0.50 to z for every one-unit increase in its feature, while a coefficient of −1.20 subtracts 1.20. The contribution table helps you spot dominant drivers, detect sign mistakes, and confirm feature scaling, especially when standardized inputs are mixed with raw units.
Odds, logit, and odds ratios
Probability is intuitive, but odds can be more sensitive near extremes. Odds are p/(1−p), and the logit equals ln(odds). Odds ratios are exp(β), meaning a one-unit increase in a feature multiplies odds by exp(β) when other features are held constant. If exp(β)=1.35, odds rise by 35% per unit; if exp(β)=0.80, odds fall by 20%. This interpretation supports stakeholder communication and feature impact reviews.
Choosing a threshold with metrics
A default threshold of 0.50 is not always optimal. When false positives are costly, raise the threshold; when missing positives is worse, lower it. Evaluate thresholds using precision, recall, F1, and a confusion matrix on validation data. For imbalanced problems, also monitor PR-AUC, not only ROC-AUC. This calculator lets you test thresholds and see how the predicted class changes, supporting policy comparisons.
Calibration and responsible deployment
Accurate ranking does not guarantee calibrated probabilities. Check calibration curves and use techniques like Platt scaling or isotonic regression if needed. Track drift by monitoring feature distributions and predicted probability over time. For sensitive decisions, document inputs, explainability artifacts, and human override rules. The batch mode and exports here support repeatable audits: score multiple rows, store outputs, and compare probability shifts after model updates.
FAQs
1) What does the linear score z represent?
z is the weighted sum of inputs: intercept plus each coefficient times its feature value. Higher z means higher probability after the logistic transform.
2) Why can two rows have similar probabilities with different features?
Different combinations of features can produce the same z. The contributions table helps you see which predictors offset each other to reach a similar score.
3) How should I pick a threshold?
Choose a threshold based on costs and desired tradeoffs. Validate several thresholds using precision, recall, and a confusion matrix, then select the one that matches your decision policy.
4) What is an odds ratio in this context?
The odds ratio is exp(β). It tells how many times the odds change for a one-unit increase in that feature, holding other features constant.
5) Why does calibration matter if accuracy looks good?
A model can rank cases correctly but still output probabilities that are too high or too low. Calibration checks whether predicted probabilities match observed frequencies.
6) How does batch mode handle missing values?
If a batch cell is blank, it is treated as 0 during scoring. For real deployments, handle missingness consistently with the preprocessing used during model training.