What is the difference between regression and classification?

What is the difference between regression and classification, when we try to generate output for a training data set $x$?


Solution 1:

Regression: the output variable takes continuous values.

Classification: the output variable takes class labels.

Solution 2:

Regression involves estimating or predicting a response.

Classification is identifying group membership.