Classification Algorithm-Logistic Regression

The linear classification formula is used as the input of logistic regression, and the classification is completed when it returns, and there is also a probability value. Used for: ad click rate, judging the gender of the user, predicting whether the user will buy a given product category, and judging whether a review is positive or negative. Logistic regression is to solve the problem of binary classification.

Logistic regression formula:

Output: [0,1] interval

g(z) is the sigmoid function

sigmoid function graph:

Loss function, optimization

The principle is the same as linear regression, but because it is a classification problem, the loss function is different, and it can only be solved by gradient descent.

Log-likelihood loss function:

The complete loss function:

The smaller the value of cost loss, the higher the accuracy of the predicted category

 

 

 

Guess you like

Origin blog.csdn.net/qq_38851184/article/details/114002306