Decision Boundary vs Threshold in Logistic Regression

Hey guys, I was trying to understand the relationship between the decision boundary and threshold. In week 3, we say that the decision boundary is defined by when w.x+b=0 and this is when g(z) >=0.5

What confuses me here is, say if i choose the threshold as 0.2 where y_pred = 1 when g(z)>=0.2. Will this change the equation for my decision boundary?

Or are these 2 independent and I’m confusing the decision boundary and threshold?

Please see the image below for reference

Question 2:
Why is y_pred = 1 here inside the ellipse?

Yes, it will. the boundary will now be the locus of points where the value is 0.2, instead of 0.5.

Note that there is almost never a good reason for using a threshold other than >= 0.5.

1 Like

Thanks for explaining that. A lot of the posts i read on reddit about this had confused me more as well but this really helps!

I recommend you come to the forum first with your questions. There are lots of community members and mentors who know this material very well.

1 Like

Hi adishri,
1.5 years later, I have the same question: why is y_pred = 1 in the ellipse? (and also in the more complex decision boundary below the ellipse)

It seems to be a typo to me. Did you get an answer?

Best,
Antoine

It’s not a typo.

Whether the 1’s are inside the boundary or outside depends on how the data set is labeled. The weights will be learned (including the sign of the weights) based on the training data.

Since the figure doesn’t provide any training data, or any values for the weights, you can’t really derive the solution from that image.