A logistic regression model gives P(y=1∣x)=σ(w⊤x+b), with w=(2,−1), b=−1 and σ(z)=1/(1+e−z). (a) What is the decision boundary for threshold 0.5? (b) What is it for threshold 0.8? (c) How is the point x=(1,0) classified under each threshold?

Supervised learning, Logistic regression
Level L2 Elementary. Length Short. Nature Mat Mathematical.

What's being asked

Whether you know the boundary is where the score w⊤x+b equals a constant, so it is a straight line, and that changing the threshold moves the line parallel to itself.

Key idea

Because σ is increasing, σ(z)≥τ exactly when z≥ln⁡τ1−τ. So the boundary for threshold τ is the line w⊤x+b=ln⁡τ1−τ. For τ=0.5 the right side is 0; for τ=0.8 it is ln⁡4≈1.386.

Steps

  1. Invert the sigmoid. Solving σ(z)=τ gives e−z=1−ττ, so z=ln⁡τ1−τ. This value is called the logit of τ.
  2. (a) For τ=0.5 the logit is 0, so the boundary is 2x1−x2−1=0, i.e. x2=2x1−1. Predict class 1 where 2x1−x2−1>0, which is the region below this line.
  3. (b) For τ=0.8 the logit is ln⁡4≈1.386, so the boundary is 2x1−x2−1=1.386, i.e. x2=2x1−2.386. The slope is the same, so the line is parallel. It sits lower, so the class-1 region shrinks, as you would expect from a stricter threshold.
  4. (c) At (1,0) the score is z=2(1)−0−1=1, and σ(1)≈0.731. This is above 0.5 but below 0.8, so the point is class 1 under threshold 0.5 and class 0 under threshold 0.8.

Common mistakes

How long your answer should be

4–5 lines of working.

Last checked on 4 December 2026.

Read this

Previous in Supervised learning: Why does a random forest have lower variance than a single deep decision tree?
Next in Supervised learning: A spam filter uses two yes/no features: O = “contains the word offer” and L = “contains a link”. The training set has 10 emails: 4 spam and 6 ham (not spam). Among spam, O=1 in 3 emails and L=1 in 3. Among ham, O=1 in 1 email and L=1 in 2. Using Bernoulli naive Bayes, how is a new email with O=1,L=0 classified (a) with maximum-likelihood estimates and (b) with Laplace (add-one) smoothing, and what is the posterior P(spam∣x) in each case?