Skip to main content

Logistic Regression Predictions With Sigmoid Intuition

Set coefficients and input features to see how logistic regression converts them into probabilities and classifications. This is a demonstration tool for learning — not for real-world decisions.

Last Updated: February 13, 2026

Logistic regression predicts binary outcomes—yes or no, pass or fail, click or ignore—by estimating the probability of one class. A credit analyst evaluating loan applications uses a logistic model: coefficients on income, debt-to-income ratio, and credit score combine through the sigmoid function to yield a default probability of, say, 0.23. The common mistake is treating coefficients as direct probability changes. A coefficient of 0.5 doesn't mean "probability increases by 0.5 per unit"; it means log-odds increase by 0.5, which translates to different probability shifts depending on where you start on the curve. When reading results, focus on the final probability and what the odds ratio (e^β) tells you about relative risk.

Logit to Probability: The Sigmoid Explained

Logistic regression first computes a linear predictor z = β₀ + β₁x₁ + β₂x₂ + … where βs are coefficients and xs are feature values. This z can range from negative infinity to positive infinity—it's the log-odds of the positive class.

The sigmoid function σ(z) = 1 / (1 + e^(−z)) transforms z into a probability between 0 and 1. Large positive z yields probability near 1; large negative z yields probability near 0; z = 0 yields exactly 0.5. The S-shaped curve is steepest at the midpoint—small changes in z produce the largest probability shifts when probability hovers around 0.5.

Understanding the sigmoid matters because it shows why coefficient effects are non-linear in probability terms. A one-unit increase in a feature always adds the same amount to z (the linear predictor) but adds a variable amount to probability depending on where you sit on the curve.

p = 1 / (1 + e^(−z))

where z = β₀ + β₁x₁ + β₂x₂ + … (the log-odds)

Enter Coefficients and See Class Probabilities

Provide the intercept (β₀) and coefficients for each feature. In real applications, these come from training a model on labeled data via maximum likelihood estimation. Here, you enter them manually to explore how changes affect predicted probabilities.

Then input feature values (x₁, x₂, …). The tool computes z, applies the sigmoid, and reports the probability of class 1. The probability of class 0 is simply 1 − p.

Experiment by varying feature values while holding coefficients fixed. Watch how probability responds—a large positive coefficient on a feature makes probability climb steeply as that feature increases; a negative coefficient makes probability fall.

Threshold Tuning: Precision vs Recall Intuition

A classification threshold converts probability into a binary decision. The default 0.5 means "classify as positive if p ≥ 0.5." But 0.5 isn't always optimal—it depends on the cost of errors.

Lower the threshold (e.g., 0.3) when missing positives is expensive. Medical screening for a serious disease might use a low threshold to catch more true cases, accepting more false alarms. Raise the threshold (e.g., 0.7) when false positives are costly—spam filtering on critical inboxes, for instance, where mislabeling a legitimate email hurts more than letting some spam through.

Threshold selection trades off precision (of those labeled positive, how many truly are) against recall (of all true positives, how many did we catch). Moving the threshold doesn't change the underlying probability estimate—only the decision boundary.

Practical tip: In production, analysts use ROC curves or precision-recall curves to pick a threshold that balances business objectives. This tool lets you see how threshold shifts change the classification for a single observation.

Odds Ratios: What a Coefficient Means

Odds are p / (1 − p). If probability of success is 0.8, odds are 0.8 / 0.2 = 4 (four-to-one in favor). The coefficient β in logistic regression tells you how much the log-odds change for a one-unit increase in x.

The odds ratio OR = e^β translates that to a multiplicative effect on odds. If β = 0.5, OR ≈ 1.65, meaning odds increase by 65% per unit increase in x. If β = −0.3, OR ≈ 0.74, meaning odds multiply by 0.74 (a 26% decrease).

Odds ratios are often easier to communicate than raw coefficients. "Each additional year of experience multiplies the odds of promotion by 1.3" is more intuitive than "the coefficient on experience is 0.26."

OR = e^β

OR > 1 → increased odds | OR < 1 → decreased odds | OR = 1 → no effect

Limitations: Not a Full Training Tool

This calculator demonstrates how logistic regression makes predictions given coefficients you supply. It does not estimate coefficients from data—that requires maximum likelihood estimation on a labeled dataset, typically done in Python (scikit-learn), R, or specialized software.

Real models also need validation: train/test splits, cross-validation, calibration checks, and diagnostic plots (ROC, confusion matrices). Coefficients have standard errors and confidence intervals that this tool doesn't compute.

Treat outputs here as educational explorations, not production predictions. For any consequential decision—loan approvals, medical diagnoses, hiring—use validated models built by qualified professionals with proper data governance.

Warning: Never use manually entered coefficients for real decisions. Real coefficients come from careful model training and must include uncertainty estimates.

Logit Predictor Questions

Why doesn't a coefficient of 0.5 add 0.5 to probability?

Coefficients operate on log-odds, not probability. The sigmoid function's curvature means the same log-odds shift produces different probability changes depending on where you start. Near p = 0.5, small log-odds changes have big probability effects; near p = 0 or 1, they have small effects.

What does a negative coefficient mean?

It means increasing that feature decreases the probability of the positive class. For example, a negative coefficient on "days since last purchase" in a repeat-buyer model indicates longer gaps associate with lower likelihood of buying again.

Can I compare coefficients across features?

Only if features are on comparable scales. A coefficient of 2.0 on a feature measured in thousands differs in meaning from 2.0 on a feature measured in single units. Standardize features (z-scores) first if you need to compare relative importance.

How do I know if my threshold is correct?

Threshold choice depends on costs. If false negatives are expensive, lower the threshold. If false positives are expensive, raise it. ROC curves and precision-recall analysis help find the sweet spot for your application.

Why can probability never actually reach 0 or 1?

The sigmoid function approaches but never touches 0 or 1. Mathematically, you'd need z = −∞ or z = +∞. In practice, probabilities get close enough (e.g., 0.0001 or 0.9999) that the distinction rarely matters.

Limitations & Assumptions

• Hypothetical Coefficients: This tool uses user-supplied coefficients, not estimates from real data. Outputs are illustrative, not production-ready.

• Linearity in Log-Odds: Logistic regression assumes the log-odds is a linear function of features. If the true relationship is non-linear, predictions suffer.

• Independence Assumption: Observations are assumed independent. Clustered or repeated-measures data require specialized methods.

• Binary Outcomes Only: Standard logistic regression handles two classes. Multi-class problems need multinomial or ordinal extensions.

Disclaimer: This calculator demonstrates logistic regression concepts for learning purposes. It is not a substitute for properly trained and validated models. For credit scoring, medical diagnosis, or any consequential application, use professional software (R, Python's scikit-learn, SAS) with qualified oversight.

Sources & References

Formulas and interpretation guidelines follow standard machine learning references:

Frequently Asked Questions

Common questions about logistic regression, binary classification, sigmoid function, log-odds, odds ratios, classification thresholds, coefficients interpretation, and how to use this educational tool for homework and machine learning practice.

What is the difference between logistic regression and linear regression?

Linear regression predicts continuous numeric values (like price or temperature), while logistic regression predicts the probability of a binary outcome (like yes/no or pass/fail). Logistic regression uses the sigmoid function to constrain outputs between 0 and 1, making it suitable for classification tasks.

Why do we use the sigmoid function?

The sigmoid function σ(z) = 1/(1+e⁻ᶻ) transforms any real number into a value between 0 and 1, which can be interpreted as a probability. It's smooth, differentiable (important for optimization), and has a natural interpretation: large positive z values give probabilities near 1, large negative values give probabilities near 0, and z=0 gives exactly 0.5.

What do the coefficients (β values) represent?

Each coefficient represents the change in log-odds for a one-unit increase in its corresponding feature. The intercept (β₀) is the log-odds when all features are zero. Positive coefficients increase the probability of class 1, while negative coefficients decrease it. The magnitude indicates the strength of the effect.

What is log-odds and why do we use it?

Log-odds (or logit) is the natural logarithm of the odds ratio: log(p/(1-p)). We use it because it transforms probabilities (bounded 0-1) into an unbounded scale (-∞ to +∞), allowing us to model them with a linear combination of features. The logistic regression directly models the log-odds as a linear function.

How do I choose the right threshold?

The default threshold of 0.5 treats false positives and false negatives equally. Lower it (e.g., 0.3) when missing positives is costly (medical diagnosis), raise it (e.g., 0.7) when false positives are costly (spam detection with important emails). In practice, you'd use ROC curves and consider the specific costs of different error types.

Can I use this calculator for real predictions?

No! This is strictly an educational tool. The coefficients you enter are hypothetical. Real logistic regression models must be trained on data using maximum likelihood estimation, validated on held-out data, and their coefficients have uncertainty (confidence intervals). Never use manually-entered coefficients for real decisions.

What is an odds ratio?

The odds ratio for a coefficient is e^β. It tells you how much the odds multiply for each one-unit increase in that feature. For example, if β=0.7, the odds ratio is e^0.7 ≈ 2.01, meaning the odds of the positive class roughly double for each one-unit increase. An odds ratio of 1 means no effect.

Why might I want 3 inputs instead of 2?

More features allow you to explore how multiple factors interact in determining the probability. With 3 inputs, you can model scenarios where the outcome depends on multiple independent variables—like predicting loan default based on income, credit score, and debt-to-income ratio. This demonstrates the multivariate nature of real models.

What does the sigmoid curve visualization show?

The chart shows how the predicted probability changes as one feature varies while others stay constant. The S-shaped curve is characteristic of logistic regression. The steepness depends on the coefficient magnitude. The threshold line shows where the classification switches from 0 to 1.

How are real logistic regression coefficients estimated?

Real coefficients are estimated using Maximum Likelihood Estimation (MLE), which finds coefficient values that maximize the probability of observing the training data. This is typically done using iterative optimization algorithms like Newton-Raphson or gradient descent. The process also produces standard errors and confidence intervals for each coefficient.

Logistic Regression Predictor: Sigmoid + Probabilities