Two Forms of Logistic Regression
There are two forms of Logistic Regression used in literature. In this post, I will build a bridge between these two forms and show they are equivalent.
Logistic Function & Logistic Regression
The common definition of Logistic Function is as follows:
where is the variable of the function and . One important property of Equation (1) is that:
The form of Equation (2) is widely used as the form of Logistic Regression (e.g., [1,2,3]):
where is a feature vector and is a coefficient vector. By using Equation (2), we also have:
This formalism of Logistic Regression is used in [1,2] where labels and the functional form of the probability to generate different labels is different. Another formalism introduced in [3] unified the two forms into one single equation by integrating the label and the prediction together:
where is the label for data item . It is also easily to verify that .
The Equivalence of Two Forms of Logistic Regression
At first glance, the form (3) and the form (4) looks very different. However, the equivalence between these two forms can be easily established. Starting from the form (3), we can have:
We can also establish the equivalence between and easily by using property (2). Another way to establish the equivalence is from the classification rule. For the form (3), we have the following classification rule:
An exactly same classification rule for the form (4) can also be obtained as:
Therefore, we can see that two forms essentially learn the same classification boundary.
Logistic Loss
Since we establish the equivalence of two forms of Logistic Regression, it is convenient to use the second form as it can be explained by a general classification framework. Here, we assume is the label of data and is a feature vector. The classification framework can be formalized as follows:
where is a hypothesis function and is loss function. For Logistic Regression, we have the following instantiation:
where .
References
[1] Trevor Hastie, Robert Tibshirani, and Jerome Friedman. The Elements of Statistical Learning. Springer Series in Statistics. Springer New York Inc., New York, NY, USA, 2001.
[2] Tom M. Mitchell. Machine learning. McGraw Hill series in computer science. McGraw-Hill, 1997.
[3] Jason D. M. Rennie. Logistic Regression. http://people.csail.mit.edu/jrennie/writing, April 2003.