Calculator
Example data table
| Logit z | Probability p | Odds p/(1-p) | Decision (threshold 0.50) |
|---|---|---|---|
| -4 | 0.017986 | 0.018316 | Negative |
| -2 | 0.119203 | 0.135335 | Negative |
| 0 | 0.500000 | 1.000000 | Positive |
| 2 | 0.880797 | 7.389056 | Positive |
| 4 | 0.982014 | 54.598150 | Positive |
Formula used
The sigmoid converts a logit score into a probability:
- z is the logit (log-odds) or linear model score.
- In feature mode: z = b0 + Σ(ci · xi).
- Odds are p/(1−p), and the derivative is p(1−p).
How to use this calculator
- Select an input mode: direct logit or features.
- Enter your score z, or fill coefficients and values.
- Choose a threshold and decimal precision if needed.
- Press Submit to view probability above the form.
- Download CSV or PDF for auditing, sharing, or reporting.
Logits to probabilities at scale
A logit is a log-odds score produced by a linear model. This tool transforms z into p using the sigmoid curve, making scores comparable across experiments. For reference, z = −4 gives p ≈ 0.0180, z = −2 gives p ≈ 0.1192, z = 0 gives p = 0.5000, z = 2 gives p ≈ 0.8808, and z = 4 gives p ≈ 0.9820. These anchors help you sanity-check pipelines before scoring production data. To avoid numerical overflow, stable evaluation uses exp(-z) for positive z and exp(z) for negative z. This keeps p within [0,1] even for z beyond ±20, where standard math may underflow. Use the history table to compare runs, then export CSV or PDF for stakeholders. Store outputs to support internal audits.
Building z from features
When you select feature mode, the tool computes z = b0 + Σ(ci·xi). This mirrors common logistic regression and linear classifiers. Using b0 = −1.2, c1 = 0.8 with x1 = 2.5 adds 2.0 to the score, while c2 = −0.4 with x2 = 3 subtracts 1.2. The resulting z = −0.4 yields p ≈ 0.4013, showing how opposing signals combine into one decision-ready probability.
Thresholds and decision labels
A threshold converts probability into a class label. At threshold 0.50, any p ≥ 0.50 is labeled Positive. Raising the threshold to 0.70 reduces false positives but increases false negatives. If your base rate is 10%, many teams start with thresholds between 0.2 and 0.5, then tune using validation precision, recall, and cost ratios.
Odds and interpretability
Odds are computed as p/(1−p). They translate changes in z into multiplicative effects. For p = 0.80, odds = 4.0, meaning the event is four times more likely than not. Because z equals ln(odds), a +0.69 increase in z roughly doubles the odds, a useful rule when comparing model updates.
Sensitivity via the derivative
The derivative p(1−p) peaks at p = 0.5 with value 0.25, and shrinks near 0 or 1. High derivative indicates small score shifts can flip outcomes, so it’s a good stability indicator. Track derivative alongside p to find borderline cases for review, calibration, or extra features.
FAQs
1) What does the logit z represent?
z is the log-odds of the event: z = ln(p/(1−p)). Positive z implies p > 0.5, negative z implies p < 0.5. It often comes from a linear model score.
2) When should I use feature mode?
Use feature mode when you have coefficients and input values and want the combined score. The tool computes z from b0 and Σ(ci·xi), then converts it to probability with sigmoid.
3) Why is stable mode recommended?
Very large |z| values can overflow exp() in standard math. Stable mode rearranges the sigmoid computation to avoid overflow and underflow, keeping probabilities within valid bounds for extreme scores.
4) How do I choose a threshold?
Pick a threshold based on your costs and constraints. Higher thresholds reduce false positives, lower thresholds reduce false negatives. Validate on held-out data, then tune for precision, recall, or expected value.
5) What does the derivative tell me?
The derivative p(1−p) measures sensitivity. It’s highest near p = 0.5 and low near 0 or 1. Higher sensitivity means small changes in z can shift the probability noticeably.
6) What gets exported in CSV and PDF?
Exports include timestamp, mode, z, probability, odds, threshold, label, derivative, and calculation details. Use current exports for a single run, or history exports to compare multiple scenarios consistently.