Study Note: Logistic Regression(1)

Logistic regression is created for logistic problem. Therefore, the output of such regression should be binary value. 


Then here is the question, how to create a regression function whose output is binary value?


Some wise men figured out a way to do this: put the polynomial into another function called sigmoid function as its input. 


Logistic function == Sigmoid function


Here is the figure of sigmoid function:  


Study Note: Logistic Regression(1)_第1张图片

And the expression of this function is:


Study Note: Logistic Regression(1)_第2张图片


As we said before, just put the polynomial into the function as z. We can get output range in [0,1]. 


Therefore, if we set a judge standard as: If the g(z) >= 0.5, we predict the output will be 1. Else we predict the output will be 0.


In order to let g(z) bigger than 0.5, we can translate this issue to let the polynomial's value bigger than 0. So, the line that polynomial equals 0 is the line of decision boundary. 


For example: 


Study Note: Logistic Regression(1)_第3张图片


We can see that x1+x2-3 = 0 is the line we set as decision boundary. If we want a more curve line, we can increase the polynomial's order. Then we can get some weird boundary. 


Reference: 


Pictures are stole from Andrew Ng's Machine learning course. 


你可能感兴趣的:(机器学习,Matrix,learning,machine)