# Formula for decision boundary of a classifier (in order to visualize it)

I'm confused on how to plot decision boundary for classifiers.

For example, i'm working with perceptron. So, the formula for decision boundary(if I understand this correctly) is

W1x + W2y + W_bias = 0


It's equal 0 because (again, if i understand this right): the activation function is +1 if the dot product of W and x >0 and -1 if otherwise. This makes the decision boundary equals 0. Is this right?

While this is simple for perceptron, what is the formula for decision boundary logistic regression? It can't be

sigmoid(W1x) + sigmoid(W2x) + W3 = 0


can it?

How do I determine decision boundary formula for logistic regression or any other classifier (particularly nonlinear ones)?

In general, you can try to solve for $p(x) = \frac12$ when you get a probability estimate (and the prior is bounded), or more generally if your prediction is $\mathrm{sign}(f(x))$, for $f(x) = 0$. But for nonlinear classifiers, this may be difficult to solve, and thus it's often easier to just plot the output of the classifier on a fine grid as Nick suggested.