In classification, the response variable y has discreet values as opposed to continuous values. Some examples are e-mail (spam/non-spam), transactions (safe/fraudulent), and so on.
The y variable can take two values, namely 0 or 1, as illustrated in the following equation:
Here, 0 is referred to as a negative class and 1 means a positive class. Though we are calling them positive or negative, it is only for convenience's sake. Algorithms are neutral about this assignment. Algorithms have no emotions, and 1 does not mean higher than or better than 0.
Though linear regression works well with regression tasks, it hits a few limitations when it comes to classification tasks. These include:
- The fitting process is very susceptible to outliers
- There is no guarantee that the hypothesis function h(x) will fit in the range of 0 (negative class) to 1 (positive class)
Logistic regression guarantees that h(x) will fit between 0 and 1. Though logistic regression...