Large Positive z
When z is very large (e.g., 100), e^(-z) becomes tiny, so g(z) ≈ 1
Logistic regression fits an S-shaped curve to classification data instead of the straight line used in linear regression. This produces outputs between 0 and 1, making it suitable for binary classification problems.
The sigmoid function (also called the logistic function) is defined as:
g(z) = 1 / (1 + e^(-z))
Where:
Large Positive z
When z is very large (e.g., 100), e^(-z) becomes tiny, so g(z) ≈ 1
Large Negative z
When z is very negative, e^(-z) becomes huge, so g(z) ≈ 0
z = 0
When z = 0, g(z) = 1/(1+1) = 0.5
The logistic regression model is:
f(x) = g(w·x + b) = 1 / (1 + e^(-(w·x + b)))
This outputs a value between 0 and 1 for any input x.
The output f(x) represents the probability that y = 1 given input x.
Example: If f(x) = 0.7 for a tumor classification:
In research literature, you may see:
f(x) = P(y = 1 | x; w,b)
This notation means “probability that y equals 1, given input x, with parameters w and b.”
Logistic regression combines a linear function (w·x + b) with the sigmoid function to produce probability estimates between 0 and 1. This makes it ideal for binary classification tasks where we need to estimate the likelihood of an outcome rather than just predict a category.