We use a best-fitted line to predict a continuous target in regression-based algorithms like linear regression.

What if we try to use the linear regression algorithm to predict some classes (for example, 0/1)? That isn’t a good idea (we typically convert the categorical targets or labels to integer classes 0/1).

To accomplish a classification task, we consider the line as a boundary that splits the space instead of fitting the points.

Regression vs. classification

Get hands-on with 1400+ tech skills courses.