A model scores each student with a number z (positive leans towards "will pass", negative towards "will fail"). Why does logistic regression pass z through the sigmoid function σ(z)=1/(1+e−z), and what does the output mean? For example, what does z=2 become?

Supervised learning, Logistic regression
Level L1 Beginner. Length Short. Nature Th Theoretical.

What's being asked

Whether you understand that logistic regression turns any score into a probability between 0 and 1, and can read that probability.

Key idea

A score z can be any number, from very negative to very positive, but a probability must lie between 0 and 1. The sigmoid squashes every z into that range: large negative z gives a value near 0, z=0 gives exactly 0.5, and large positive z gives a value near 1. The output is read as P(pass).

Steps

  1. State the problem. A straight-line score such as z=1⋅(hours studied)−3 can be −10 or +10, which is not a probability.
  2. Describe the sigmoid. It is an S-shaped curve. At z=0 it gives 0.5 (a coin toss), it rises towards 1 as z grows, and it falls towards 0 as z becomes very negative.
  3. Do the small calculation. For z=2: σ(2)=1/(1+e−2)=1/(1+0.135)≈0.88. Read it as: the model says this student has about an 88% chance of passing.
  4. Turn the probability into a yes/no answer if needed. Predict "pass" when the probability is above 0.5, which happens exactly when z>0.

Common mistakes

How long your answer should be

4–5 sentences with one calculation.

Read this

Previous in Supervised learning: When we fit a straight line to data points by least squares, what exactly is the line trying to make small?
Next in Supervised learning: What is a decision tree, and how does it use a chain of yes/no questions to decide the class of a new example? Use "go out to play or stay in" as your example?