9 Classification
The main application of logistic regression is the solution of binary classification problems.
One of the main applications of a logistic regression model is to classify the qualitative variable according to the value taken by the predictors. To achieve this classification, it is necessary to establish a threshold of probability at which the variable is considered to belong to one of the levels.
For example, an observation can be assigned to group \(1\) if \({P}(Y=1|X)>0.5\) and to group \(0\) otherwise. In that case, the threshold is 0.5:
\[ \hat{Y} = \begin{cases} 1 & \text{If } \,\, \hat{\pi}={P}(Y=1|X)>0.5,\\ 0 & \text{If } \,\, \hat{\pi}={P}(Y=1|X)<0.5 \end{cases} \]