# Sigmoid function > A mathematical function that "squishes" an input value into a constrained range, typically 0 to 1 or -1 to +1. That is, you can pass any number (two, a million, negative billion, whatever) to a sigmoid and the output will still be in the constrained range.[^1] A mathematical function that "squishes" an input value into a constrained range, typically 0 to 1 or -1 to +1. That is, you can pass any number (two, a million, negative billion, whatever) to a sigmoid and the output will still be in the constrained range.[^1] The sigmoid function has several uses in [machine learning](https://wiki.g15e.com/pages/Machine%20learning.txt), including: - Converting the raw output of a [logistic regression](https://wiki.g15e.com/pages/Logistic%20regression.txt) or [multinomial regression](https://wiki.g15e.com/pages/Multi-class%20logistic%20regression.txt) model to a probability. - Acting as an [activation function](https://wiki.g15e.com/pages/Activation%20function.txt) in some [neural networks](https://wiki.g15e.com/pages/Artificial%20neural%20network.txt). ## Formula The sigmoid function over an input number $x$ has the following formula: $$ sigmoid(x) = \frac{1}{1 + e^{-x}} $$ In machine learning, *x* is generally a [weighted sum](https://wiki.g15e.com/pages/Weighted%20sum.txt).[^1] ## Footnotes [^1]: https://developers.google.com/machine-learning/glossary#sigmoid-function