What Sigmoid Function Meaning, Applications & Example
Activation function that outputs values between 0 and 1.
What is the Sigmoid Function?
The Sigmoid Function is a mathematical function that maps any real-valued number to a value between 0 and 1. It is commonly used in machine learning, especially for binary classification tasks, where the output needs to represent a probability. The function has an S-shaped curve, which makes it ideal for transforming the output of a model into a probability.
Sigmoid Formula
The formula for the sigmoid function is:
\[ S(x) = \frac{1}{1 + e^{-x}} \]Where:
- \( x \) is the input to the function.
- \( e \) is Euler’s number (approximately 2.718).
Applications of the Sigmoid Function
- Binary Classification: Outputs a probability between 0 and 1 for binary outcomes (e.g., “spam” or “not spam”).
- Neural Networks: Used as an activation function in hidden layers or output layers for certain tasks.
Example of Sigmoid Function
Given an input value of \( x = 2 \), the sigmoid function outputs:
\[ S(2) = \frac{1}{1 + e^{-2}} \approx 0.88 \]This means the input has an 88% probability of belonging to the positive class in a binary classification task.