QUESTION 8 OF 10

Why is the sigmoid function used for binary classification?

Reveal the answer and explore the explanation.

08
MediumVisual

Why is the sigmoid function used for binary classification?

Answer
Answer

Maps a real-valued score to a number between zero and one.

Practical example

Convert binary logistic regression logits to probabilities.

PythonRelated concept example
from math import exp
z = 1.5
p = 1/(1+exp(-z))
print(p, int(p >= 0.5))

Separate estimated probability from the decision threshold.

Reference: Further reading ↗

Last 30 min revisionHigh-yield interview Q&As