2.2.11 · D5Linear & Logistic Regression
Question bank — Decision boundaries
Before the traps, three anchors so no symbol is used unexplained:
- is the score — a plain weighted sum of the features plus an offset. Positive means "leaning class 1", negative means "leaning class 0".
- is the sigmoid — it squashes any score into a probability between 0 and 1. It is monotonic: bigger score always means bigger probability, never a wiggle back.
- The decision boundary is the knife-edge set of points where the model ties at 50/50, which (for logistic regression) is exactly .
True or false — justify
The boundary of a logistic regression model is a curved sigmoid shape.
False. The sigmoid bends the probability surface, but the boundary is where probability , i.e. , and is a straight-line function of — a flat hyperplane.
Doubling both and moves the decision boundary.
False. The set and are identical points; scaling only steepens the sigmoid (confidence), it never relocates the border.
Changing the classification threshold from 0.5 to 0.8 tilts the boundary to a new orientation.
False. A new threshold gives , a constant; the hyperplane slides parallel to itself (new ) but keeps the same normal , so orientation is unchanged.
A model with is a nonlinear model.
False (subtly). It is linear in its weights and features — the same linear machinery — it only looks curved when projected back onto the raw plane.
Every point exactly on the boundary is predicted as class 1.
False. On the boundary the model is genuinely tied (), so the label is undefined by the model itself; a convention (e.g. "") must be chosen, it is not implied by the geometry.
The vector lies along the decision boundary.
False. is the normal — perpendicular to the boundary — and points toward the class-1 side; moving along increases fastest.
If two features are perfectly correlated, the boundary is undefined.
False, but the weights become non-unique. Many vectors give the same boundary line; the geometry is fine, only the numerical solution is unstable.
Adding more features can only make the boundary more flexible, never worse.
False. Extra (especially noisy) features let the boundary overfit, wiggling to trap training points; flexibility without regularization hurts generalization.
Spot the error
" reduces to ."
Wrong: inverts to , not . Sigmoid outputs 0.5 at input 0 — you must undo the sigmoid, not read the number off directly.
"Since is smooth and curved, the boundary between classes is smooth and curved too."
Confuses probability space with feature space. The curve is in the -vs- graph; the boundary is a level set in -space, which stays flat.
"To classify under , we need the sigmoid value first."
Unnecessary. Only the sign of matters for the label; class 0, no sigmoid arithmetic required.
"Plain logistic regression on can separate points inside a ring from points outside it."
Impossible — a ring separation is not linearly separable in raw coordinates. You must engineer a feature like first, then the boundary becomes a circle.
"The distance of a point from the boundary is just ."
Missing the normalization: signed distance is . Without dividing by , rescaling weights would fake a "farther" point.
"A softmax (multi-class) model has one boundary, like the two-class case."
For classes you get several pairwise boundaries; the space is carved into regions whose walls are the ties between adjacent classes, not a single hyperplane. See Softmax Classification.
Why questions
Why does the two-class boundary sit at probability 0.5 and not some other value?
The two class probabilities sum to 1, so they are equal exactly when each is 0.5 — that is the unique "no preference" knife-edge.
Why does correspond to exactly one score ?
Because the sigmoid is strictly monotonic (see Sigmoid Function); each output value is hit by one and only one input, so 0.5 maps back uniquely to .
Why is the logistic boundary linear even though logistic regression is a "nonlinear" model?
The nonlinearity () only reshapes probabilities; the location of the tie depends solely on , and is a straight-line function of the features.
Why does the magnitude of control confidence but not boundary location?
A larger makes change faster as you step away from the boundary, so saturates quickly — sharper confidence — but is at the same place regardless of scale.
Why can adding the product feature create a diagonal or hyperbolic boundary?
The cross-term couples the two axes, so the level set becomes a conic; the raw-space shape rotates/curves even though it is still flat in the expanded feature space.
Why do Support Vector Machines and logistic regression share the same kind of boundary?
Both produce a hyperplane ; they differ only in which hyperplane they pick — SVM maximizes the margin, logistic regression maximizes likelihood. See Support Vector Machines.
Why is Linear Regression a poor classifier despite sharing the score ?
Its output is unbounded and its squared loss punishes confident-correct points, dragging the fitted line so the implied threshold sits in the wrong place; the boundary concept is the same, the fitting objective is mismatched.
Edge cases
What is the boundary when but ?
There is no boundary — is a nonzero constant everywhere, so every point gets the same class; the model has collapsed to a single prediction.
What is the boundary when and ?
everywhere, so every point is tied at ; the whole space is boundary and nothing is classified.
In 1D, what does the "hyperplane" boundary look like?
A single point on the number line (e.g. for ); one side predicts class 0, the other class 1.
If the data are perfectly separable, is the logistic boundary unique?
No — weights can grow without bound and multiple hyperplanes achieve zero training loss; regularization is needed to pin down a single, finite boundary.
What happens to the boundary if you shift the threshold all the way to ?
The constant , pushing the parallel hyperplane out to infinity — effectively the model refuses to ever predict class 1.
For a circular boundary , which side is class 1 if ?
Outside the circle, where ; inside, gives class 0 — the sign of the engineered score, not "inside vs bigger", decides.
What if a test point falls exactly at the center of a circular boundary?
With at the origin, , firmly class 0 — the center is maximally far inside the ring, not on the fence.
Connections
- Logistic Regression — the source of the boundary these traps probe.
- Sigmoid Function — monotonicity is why "" (not ).
- Feature Engineering — the escape hatch for curved boundaries.
- Support Vector Machines — same hyperplane, different chosen one.
- Softmax Classification — the multi-boundary generalization.
- Linear Regression — shares the score, mismatches the objective.