Machine Learning Basics
In logistic regression, z = 2x − 4 is passed through the sigmoid function σ(z) = 1 ÷ (1 + e^(−z)) and the result is output as the probability of being positive. What is the output when x = 2?
- A0
- B0.5
- C1
Show answer and explanation
Answer: B. 0.5
When x = 2, z = 2 × 2 − 4 = 0, so σ(0) = 1 ÷ (1 + e⁰) = 1 ÷ 2 = 0.5. The sigmoid function maps any real number to a value between 0 and 1, approaching 1 as z grows and 0 as z falls. Logistic regression treats this value as the probability of being positive and splits items into two classes with a threshold such as 0.5; despite "regression" in its name, it is a model for classification.
- A. This is the value of z, before it is passed through the sigmoid function.
- B. Correct. σ(0) = 1 ÷ 2 = 0.5.
- C. This is the value approached when z is large enough; at z = 0 the output is 0.5.