# Decision boundary in Logistic regression?

According to me in logistic regression, we just try to get a line (polynomial) and then based on which side the point is from that line the sigmoid gives ans>=0.5 or <0.5, which we then interpret as 1 (if ans>=0.5) and 0 if (ans < 0.5). Here is a simple plot what I mean.

This is just a random line not a line predicted by any logistic regression model. Here we are only having one feature i.e., x. y is the output(0 or 1). The decision boundary here is x = -3 and x = 3.

So when we have 1 feature we try to get a good line to predict the values.

What if we have 2 features we try to get a plane instead?

This is a 3-d plot of a normal sigmoid.

So if we have 2 features say x and y. For these we are trying to get a plane in z axis which separate the points? which is in turn the decision boundary. I am really confused.? Is this what we are doing?

If yes, can someone plot a 3d plot (of sigmoid/decision boundary) for a circle. For eg:

This is also a random plot. Suppose that our points are like this and our model has given us a circle to differentiate between 0 and 1. So can anyone plot a decision boundary of something like this (which is is 3-D).

• For a 3D analogue of your circle, wouldn’t it just be points of one color inside a sphere and points of another color outside? Such a visualization might prove frustrating, but the idea makes sense, right? I do, however, see that as separate from your question about the sigmoid function, hence my answer not addressing it.
– Dave
Commented Dec 23, 2022 at 6:59
• Assume that on a table the points/marbles are distributes as show in the circle(plot above). now lets assume the red marbles are y=1 and blue one's are 0. Now to make this to 3-D, lift the red points in the air. as table top will be indicating 0 and the red one's lifted in air means 1. So I think cylinder or something like that should be the actual thing in 3-D. sphere can also be a valid here. Commented Dec 23, 2022 at 7:18
• Sphere, cylinder, cone, wilting wizard’s hat…all seem plausible in three dimensions, though only a sphere strikes me as analogous to a circle in the plane. // The business about decision boundaries seems rather unrelated to the question about the sigmoid function and perhaps should be posted as a separate question
– Dave
Commented Dec 23, 2022 at 7:26

The sigmoid function takes the linear predictor of the logistic regression and bends it into a range, $$[0,1]$$, that can interpreted as a probability. The linear predictor can take any real number, which is fine if we think about the log-odds. However, for valid probability values, the must be a transformation to restrict outputs to $$[0,1]$$.