What is the difference between regression and classification?

Regression: the output variable takes continuous values.

Classification: the output variable takes class labels.


Regression involves estimating or predicting a response.

Classification is identifying group membership.


Regression and classification are both related to prediction, where regression predicts a value from a continuous set, whereas classification predicts the 'belonging' to the class.

For example, the price of a house depending on the 'size' (in some unit) and say 'location' of the house, can be some 'numerical value' (which can be continuous): this relates to regression.

Similarly, the prediction of price can be in words, viz., 'very costly', 'costly', 'affordable', 'cheap', and 'very cheap': this relates to classification.

Each class may correspond to some range of values.