A Review of Logistic Regression

1. Model function
write picture description here
2. Activation function
write picture description hereAmong them , h(x) = p(y|x) (y=0 or y=1, when y=1, it means that when input x, the output is the probability of 1, when y When =0, it represents the possibility that the input x and the output are 0.
3. The loss function of a single training data (measures how close the probability is to y)
write picture description here
4. The loss of m training data
write picture description here
5. Why is the loss function here Like this.
Because the prediction here is that the value is a probability, the loss function method of linear regression is not suitable (why is it not suitable? Because the function obtained by that method is not a convex function, there will be multiple extreme values), then here Why is the loss function written like this? Here we have to draw the log function, because we know that the value of h(x) is the probability, so it is greater than 0 and less than 1. According to the loss function, when the probability is not much different from 1, when - The log function will approach 0, when the probability is equal to 0, when y==1.
When y=0, when the probability is not much different from 0, the -log function will approach 0, (here It is not the same as the content in the previous -log), so it can be used to measure the loss.
6. For m training samples

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325615472&siteId=291194637