Logistic regression (logistic regression) is the most commonly used machine learning method in the industry to estimate the likelihood of something and also to classify it.
in the case of classification, After learning the LR classifier is actually a set of weights w 0,w1,..., wm.
when enter When testing data in a sample set, this set of weights is calculated in a linear sums with the test data to find a z
z = W0+w1*x1+w2*x2+...+wm*xm. ① (where x1,x2,..., xm is the feature of a sample data, the dimension is m)
Then, according to the form of the sigmoid function, find out:
Σ(z) = 1/(1+exp (z)) . ②
due to sigmoid The definition field of the function is (0, 1) LR classifier is suitable for classifying two kinds of targets. The sigmoid function as the probability density function of the sample data, each sample point, The probability density of >① ② "
The key problem with the LR classifier is to find this set of weights w0,w1,..., wm. This involves The concept of a maximum likelihood estimation of MLE and an optimization algorithm.
First, logistic regression model
what is regression: regression is actually an estimate of the unknown parameters of a known formula. For example, the known formula is y   =   a*x   + b , unknown parameter is a and b Span style= "font-family: Song Body" >. We now have a lot of real data (training sample), Regression is the use of this data for a b
In fact, the logistic Regression is a linear regression after normalization of the logistic equation, that's all. As for the use of the logistic equation instead of the other, it is because this normalization method is often reasonable, can suppress large and too small results (often noise), to ensure that the mainstream results are not overlooked.
1.1 Logistic regression model
1.2 Maximum likelihood function
1.3 Newton-Raphaeson iterative method
Note: The Spark code implementation of the logistic regression classifier is referenced in the blog: Introduction to spark chapter sixth code part: http://blog.csdn.net/qustqustjay/article/details/46874071
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Logistic regression classifier (logistic Regression Classifier)