Logistic Regression With Decision Boundary (CS229)

Linear Decision Boundary

Assume $h_{\theta}(x)=g(\theta_0+\theta_1x_1+\theta_2x_2)$, and

\theta_0 \\
\theta_1 \\
\theta_2 \\
-3 \\
1 \\
1 \\

where $g(x)$ is sigmoid function we had mentioned before. According to Wikipedia, the sigmoid function’s domain are all real numbers, with return value monotonically increasing most often from 0 to 1.

To predict $y=1$ (malignant tumor) ocurrancy, we set $h_{\theta}(x)=g(\theta_0+\theta_1x_1+\theta_2x_2)\ge0.5$. It means that when the occurancy of malignant tumor is greater or equal to $50\%$, we tell the patients the tumor is predict to be malignant.

For $h_{\theta}(x)\ge0.5$, we obtain $x\ge0$, in other words,
Here comes

We can classify input data as:

$$x_1+x_2\lt3\Rightarrow h_{\theta}(x)\lt0.5\Rightarrow\text{benign}$$
$$x_1+x_2\ge3\Rightarrow h_{\theta}(x)\ge0.5\Rightarrow\text{malignant}$$

Non-linear decision boundaries


-1 \\
0 \\
0 \\
1 \\
1 \\

we’ll predict $y=1$ if $-1+x_1^2+x_2^2\ge0$, i.e. $x_1^2+x_2^2\ge1$ is a circle decision boundary.

Decision boundaries is a property of how we choose $\mathbf\theta$(i.e. hypothesis $h_{\theta}(x)$), NOT of the traning data set. The training data set is not what we use to define the decision boundary, they may be used to fit the parameters theta.

How about the more complicate case…