Logistic Regression is a model to label a sample with integer from 0 to L - 1 in which L is class number. For a L class label, it needs L - 1 vector to calculate L - 1 margins. Its formula is shown as below. Its prediction prediction function’s output is linear to samples:
\[margin_{i}=\beta _{i,0}+\beta _{i,1}x_{1}+\beta _{i,2}x_{2}+...+\beta _{i,n}x_{n}\]
Then label is decided according to L - 1 margins based on formula below.
\[\begin{split}Label = \left\{\begin{matrix} 0 & if & maxMargin \leqslant 0 \\ k & if & margin_{k} = maxMargin > 0\end{matrix}\right.\end{split}\]