Dictionary of Applied Machine Learning: 151 machine-learning terms, each with a definition, a figure, citations and a Python demo · All terms · Demos · Start here
Updated on 2026-11-22
Readiness 100/100
See also logistic regression
The sigmoid function maps the real line into the open interval $(0, 1)$. It translates the real-valued score of a binary classifier into an estimate for the probability of a specific label value. It is smooth and strictly increasing, with a derivative that approaches zero as the magnitude of the argument grows. Machine learning (ML) uses it in two roles: as an activation function inside a neuron, and as part of the log-likelihood function for learning the model parameters of a probabilistic model.

sigmoid.py, which recomputes what the entry states: the script block by block · open in ColabB-shapeA frost warning for Krems an der Donau (Austria) has to
say how likely frost is, not only whether it is expected.
Fig. 1 shows the air temperature measured
at $06{:}00$ (UTC)
at that station. A classifier that warns of frost reads
the $06{:}00$ reading of a day, its feature vector
${\mathbf x}$ with this single feature, and delivers a
real-valued score $h({\mathbf x})$. The classification is a
threshold: a frost warning for the next day is issued if and only
if $h({\mathbf x}) > 0$, and the magnitude
$|h({\mathbf x})|$ measures the confidence in that
warning. In practice it is often more useful to state a
probability. The sigmoid function translates the score
$h({\mathbf x})$ into a number between $0$ and $1$ that
can be read as the probability of frost, as
Fig. 1 shows for its last day.
pythondemos/sigmoid.py
B-frostA probabilistic model for a binary label uses the sigmoid function to turn a score into a probability. Let the label $y$ be either $1$ or $-1$, and let the score be ${\mathbf w}^{\top} {\mathbf x}$ with model parameters ${\mathbf w}$. The model reads \[ \mathbb{P}\left(y = 1 \mid {\mathbf x}\right) = \sigma\big({\mathbf w}^{\top} {\mathbf x}\big) \text{,} \qquad \mathbb{P}\left(y = -1 \mid {\mathbf x}\right) = \sigma\big(-{\mathbf w}^{\top} {\mathbf x}\big) \text{,} \] where the second follows from the symmetry $\sigma(-z) = 1 - \sigma(z)$. Both cases are the single expression $\sigma(y \, {\mathbf w}^{\top} {\mathbf x})$, which is where the sigmoid function enters the log-likelihood. For a training set $\mathcal{D}^{(\rm train)} = \big\{ \left( {\mathbf x}^{(r)},y^{(r)} \right) \big\}_{r=1}^{m}$ of labeled data points, the log-likelihood of the model parameters is \[ \sum_{r=1}^{m} \ln \sigma\big( y^{(r)} {\mathbf w}^{\top} {\mathbf x}^{(r)} \big) \text{.} \] Maximizing it over ${\mathbf w}$ is maximum likelihood estimation, and it is logistic regression (Bishop and Bishop, 2024, Sect. 5.4.3; Shalev-Shwartz and Ben-David, 2014, Sect. 9.3). Each summand is the negative of a logistic loss, so maximizing the log-likelihood and minimizing the average logistic loss are the same computation (Bishop, 2006, Sect. 4.3.2). For example, consider the classifier map $h$ learned by logistic regression from the days of $2024$ at Krems. Where its score is zero the sigmoid returns $1/2$, so the warning is issued exactly where the probability passes one half. A score of $0.907$ becomes a probability of $0.71$ for frost tomorrow, and a score of $-2.534$ becomes $0.07$.
Synonyms: logistic function.
See also: activation function, rectified linear unit, softmax function, logistic regression, linear model, classifier, probability, smooth.
@misc{dictml_sigmoid,
author = {Jung, Alexander},
editor = {Olioumtsevits, Konstantina and Schnoor, Ekkehard},
title = {sigmoid function},
howpublished = {Dictionary of Applied Machine Learning (course edition)},
year = {2026},
doi = {10.5281/zenodo.21569296},
note = {ISBN 978-952-64-3013-3, CC BY 4.0, retrieved 2026-11-26},
url = {https://dictionaryofml.org/terms/sigmoid.html}
}