AI Glossary / Graphs and symbolic AI / Intermediate

Expit

Definition

Expit is another name for the logistic sigmoid function, which maps a real number to a value between zero and one. It is defined by expit(z) = 1 / (1 + exp(−z)). It is the inverse of the logit function and is widely used to convert modeled log-odds into probabilities.

What it means

The input z can be negative, zero, or positive. An input of zero gives 0.5. Positive inputs give values above 0.5, and negative inputs give values below 0.5. Larger inputs produce larger outputs.

For finite real inputs, the mathematical output lies strictly between zero and one. It approaches the endpoints as the input grows very negative or very positive. Numerical software can round extreme results to an endpoint.

The output range makes expit useful in binary probability models and neural-network components. However, mapping an arbitrary score into this range does not automatically make it a reliable probability. That interpretation depends on the surrounding model, fitting procedure, and calibration against appropriate data.

How it works

First calculate a real-valued input, often called a logit in machine-learning usage. In binary logistic regression, it is commonly an intercept plus a weighted sum of features.

Apply the expit formula to obtain p. If z has the log-odds interpretation, then p / (1 − p) = exp(z), so applying the natural logarithm to those odds recovers z. Conversely, expit(log(p / (1 − p))) = p for 0 < p < 1.

The curve changes fastest near zero and becomes flatter toward either end. Its derivative is p(1 − p), which reaches a maximum of 0.25 at p = 0.5. This saturation matters when the function is used in learning calculations.

Implementations should use numerically appropriate library functions for extreme inputs. Directly evaluating an exponential can overflow even when the final mathematical result is well behaved. The function's definition and a robust way to compute it are related but distinct concerns.

Three practical examples

1. A binary logistic-regression model converts a linear score into its modeled probability of one of two outcomes.

2. A neural network uses a sigmoid gate to obtain a value between zero and one that controls how strongly information passes through a component.

3. An analyst converts fitted log-odds back to the probability scale when explaining model outputs to a nontechnical audience.

Think of it this way

Think of a smooth dimmer that translates an unrestricted control signal into an intensity between fully off and fully on. Moderate changes near the middle have more visible effect than equally sized changes near the extremes.

The analogy is limited: expit is a precise mathematical curve, and its bounded output does not certify the meaning of the input. A dimmer setting resembles a probability numerically without necessarily representing uncertainty about an event.

Worked example

Suppose a model produces z = ln(4), approximately 1.3863. Then exp(−z) = 1/4, so expit(z) = 1 / (1 + 1/4) = 0.8. The corresponding odds are 0.8 / 0.2 = 4 to 1.

Now increase the logit by ln(2). The new input is ln(8), so the odds double to 8 to 1. The probability becomes 8/9, approximately 0.8889. Doubling the odds does not double the probability and does not necessarily add a fixed number of percentage points.

For comparison, z = 0 gives odds 1 to 1 and probability 0.5. An input of −ln(4) gives odds 1 to 4 and probability 0.2, illustrating expit(−z) = 1 − expit(z).

If a decision rule uses threshold p ≥ 0.75, the equivalent logit threshold is z ≥ ln(3), approximately 1.0986. Choosing that threshold is a separate decision from computing expit. The calculation alone does not establish that 0.75 is suitable for any particular application.

These are exact identities with rounded decimal displays, not outputs from an executed model.

Illustrative case study

Fictional case: Pine Analytics displays expit-transformed scores from a prototype ranking system as success probabilities. Reviewers discover that the original scores were never trained or calibrated for that interpretation.

The team changes the labels while evaluating whether a probability model is appropriate. It retains the transformation where a bounded control value is needed but stops presenting every such value as measured confidence. The case illustrates the difference between a function's numerical range and the semantic claim attached to its output.

Common misconceptions and mistakes

Do not confuse expit with the exponential function. Exponentiation maps real inputs to positive numbers without an upper bound; expit maps them to a bounded interval.

Do not interpret a change in log-odds as an equal change in probability. The relationship is nonlinear.

Avoid assuming that applying expit separately to several class scores makes them sum to one. Multiple independent sigmoid outputs and a normalized multiclass probability distribution serve different purposes.

Do not equate a value near one with verified certainty. Model errors and poor calibration remain possible even when the numerical output is extreme.

Business use

Understanding expit helps business users interpret binary model scores, thresholds, and probability displays. It is especially useful when explaining why a coefficient's effect depends on the starting probability.

Keep raw scores, transformed probabilities, and final decisions distinct in reports. Confirm how the model was trained and evaluated before using probability language. If a threshold changes, document the operational trade-off it represents rather than treating the transformation itself as a recommendation to act.

People also ask

Are expit and logistic sigmoid the same function?

Yes. Expit is a name emphasizing its role as the inverse of logit.

What is expit(0)?

Exactly 0.5.

Do several expit outputs necessarily sum to one?

No. Each is transformed independently unless the wider model imposes additional structure.

Check your understanding

If a logit changes from ln(4) to ln(8), does the probability change from 0.8 to 1.6?

Answer: No. The odds double, and the new probability is 8/9, approximately 0.8889. A probability cannot exceed one.

Related terms

  • Logit
  • Logistic regression
  • Odds
  • Log-odds
  • Calibration
  • Activation function
  • logistic sigmoid
  • decision threshold

Learn next

Review odds and log-odds, then calculate expit at zero and several positive and negative inputs. Compare equal logit increments at different starting points. Follow with probability calibration to distinguish a correctly computed transformation from a trustworthy prediction.

  • Log-odds
  • Probability calibration
  • Odds
  • Logit

More in Graphs and symbolic AI

  • Expected value - Expected value is the probability-weighted average of a numerical quantity's possible values. It is also called the mean or expectation.
  • Expectiminimax - Expectiminimax is a game-tree search method that extends minimax to include random events.
  • Expectiminimax value - An expectiminimax value is the value assigned to a game-tree position by combining maximizing choices, minimizing choices, and probability-weighted chance...
  • Explanation-based learning - Explanation-based learning, or EBL, uses existing domain knowledge to explain an example and derive a reusable rule from that explanation.
  • Exploitation - Exploitation is choosing an action that looks best according to what an agent currently knows.
  • Exponential search - Exponential search is a method for finding a value in sorted data by first expanding a search boundary geometrically, usually by doubling positions, and...

Sources

Primary source: SciPy documentation, scipy.special.expit, defining the logistic sigmoid and its inverse relationship to logit: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.expit.html

The odds calculations, threshold conversion, and fictional case are original teaching material. No particular library version or backend capability is required for the mathematical explanation.

Previous: Expert system Next: Explainability

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer