[] Machine learning logistic regression cost function and gradient descent equation is derived - reprint

1. Loss Function and Its Solution

Model linear regression model are as follows:

 

 

 

 

Logistic regression model definition (needs the Sigmoid function):

 

 

 

 

The above-described linear regression model brought to g (x) to give a final logistic regression model:

 

 

 

 

Assuming equal probability of the expressions of class 1, class 0 NATURAL equal probability equal to 1 minus the probability of the class is equal to, the following:

 

 

 

 

The above two equations integrated into a following formula:

 

 

 

 

Then the likelihood function is

 

 

 

 

m represents the number of samples, in order to facilitate the calculation, to give logarithmic

 

 

 

 

Seeking a maximum value of the above formula, the introduction of factor -1 / m, for the sake of conversion of the minimum value of the formula:

 

 

 

 

This is the log loss function logistic regression, in which

 

 

 

 


By then we gradient descent update theta

 

 

 

 

Where α is the learning step.
The following presents how the partial derivative derived above:

 

 

 

 

Derivative of the sigmoid function as:

g(x)' = g(x)*(1-g(x))

 derivation of the derivative of the sigmoid function: the Click here Wallpaper

 

Guess you like

Origin www.cnblogs.com/qinyuguan/p/11717244.html