The decision boundary found by your classifier?

1.6k Views Asked by At

Can someone please explain in terms of "How To" find the decision boundary found by your classifier? If I plot using Octave:

plot(theta);

I get nothing like I should see. If theta is:

theta = [-6, 1, 0];

I believe the answer should be:

enter image description here

Where the form is:

enter image description here

enter image description here

But I do not understand how and why. Please enlighten me!

EDIT I am guessing, this graph is of the Sigmoid itself. The -6 is outright confusing.

Thank you Roland and Grand_chat for your help! I think I understand now! Thank you both!

3

There are 3 best solutions below

0
On BEST ANSWER

If $g(t) = 1/(1+e^{-t})$ and your classifier $h_\theta$ is designed to return one class if $h_\theta(x)>0.5$ and the other class if $h_\theta(x)<0.5$, then the decision boundary is the set of $x=(x_1,x_2)$ such that $$ h_\theta(x) = 0.5\tag1 $$ By definition of $h_\theta$, (1) is equivalent to $$ g(\theta_0+\theta_1x_1 +\theta_2 x_2) = 0.5\ .\tag2 $$ If you rearrange the equation $$ {1\over 1+e^{-z}} =: g(z) = 0.5 $$ to solve for $z$, you'll find that $z=0$. Therefore (2) is equivalent to $$ \theta_0 + \theta_1x_1 + \theta_2x_2 = 0\tag3 $$ and (3) is the final form of your decision boundary. Plug in the given values of $(\theta_0,\theta_1,\theta_2)$ into (3) and you'll get the equation of a line: $$ -6 + 1x_1 + 0x_2 = 0 $$ which simplifies to the line $$x_1 = 6\ .$$

0
On

Suppose $g$ 'classifies' as $y=1$ when it's argument is $>0$ and $y = 1$ when it's argument is $<0$. (Most classifier functions work this way).

You have that the argument is $\theta_0 + \theta_1 x_1 + \theta_2x_2$ and we are asked which kind of classification results from the choice $\theta_0 = -6, \theta_1 = 1, \theta_2 = 0$.

The first thing to note is that $\theta_2 = 0$, which means that the argument reduces to $\theta_0 + \theta_1 x_1$, which is independet of $x_2$. This is what you see immediately in the picture: The classification boundary is independent of $x_2$, i.e. has the same value for every $x_2$ and is therefore parallel to the $x_2-$axis. Furthermore, we see that $\theta_0 = -6$, i.e. if $x_1= 6$, then $\theta_0 + \theta_1 x_1 = 0$, i.e. the decision boundary where the argument switches the sign is precisely the line $x_1 = 6$ (and $x_2$ being arbitrary).

0
On

Roland and grand_chat both have correct answers. I see where I was going wrong. Probabitlity!

enter image description here

-6 becomes +6 by moving to the other side of the equation. X$1$ = 1 and X$2$ = 0 is the transition from 1 to 0.