机器学习笔记之决策边界

来源:互联网 发布:jquery 1.12.4.js下载 编辑:程序博客网 时间:2024/06/15 02:21

Decision Boundary

In order to get our discrete 0 or 1 classification, we can translate the output of the hypothesis function as follows:

hθ(x)0.5y=1hθ(x)<0.5y=0

The way our logistic function g behaves is that when its input is greater than or equal to zero, its output is greater than or equal to 0.5:

g(z)0.5whenz0

Remember.

z=0,e0=1g(z)=1/2z,e0g(z)=1z,eg(z)=0

So if our input to g is θTX, then that means:

hθ(x)=g(θTx)0.5whenθTx0

From these statements we can now say:

θTx0y=1θTx<0y=0

The decision boundary is the line that separates the area where y = 0 and where y = 1. It is created by our hypothesis function.

Example:

θ=510y=1if5+(1)x1+0x205x10x15x15

In this case, our decision boundary is a straight vertical line placed on the graph where x1=5, and everything to the left of that denotes y = 1, while everything to the right denotes y = 0.

Again, the input to the sigmoid function g(z) (e.g. θTX) doesn't need to be linear, and could be a function that describes a circle (e.g. z=θ0+θ1x21+θ2x22) or any shape to fit our data.


原创粉丝点击