# What is the difference between classification and regression?

I understand classification....a discrete response or category, like animal is dog or cat.

The author says..."Regression techniques predict continuous changes such as the change in temperature, power demand, or stock market prices."

I can't wrap my head around what he means.

Thanks.

For the sake of illustration, let's imagine that you're trying to predict the amount of gas in the tank of your car.

A classification problem statement of this question would be whether you have gas in your car (yes or no).

A regression statement of this problem would predict the level of gas in your car (anywhere between completely full or completely empty) and could take any value.

The output of a classification model can be one of n options, where n is the number of classes (and/or the probability associated with each class).

The output of a regression model is a (possibly bounded) continuous value.

• Data science noob here. Would you say Gaussian Naive Bayes is a classification model or regression? The gas tank comment you made seems to be a distribution, not really a set of discrete numbers. – Jaguar Aug 3 '19 at 4:00
• Gaussian Naive Bayes is a classification algorithm. The answer given by the gas tank classifier would answer "do I have gas in my car?" The answer given by the gas tank repressor would answer "how much gas do I have in my car?" – Thomas Cleberg Aug 5 '19 at 11:10

Understanding the difference with an example will be very easy.

Classification:- When you are asked to predict whether a patient will survive or no from a disease X given all the necessary data of the patients who survived or died due to the same disease X in the past and also given data for predicting the same on the current dataset.

Regression:- When you are asked to find the selling price of a car given the required information of the cars that were sold in the past with their prices and similar features for the test set (cars).

In other words, we can also say that if we want to find out a discrete answer then it will be a Classification problem and if we want to find out continuous (range-based) predictions then it will be a Regression problem

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.

both are the example of supervised learning.

eg : price of a house depending on the 'size' (sq. feet or whatever 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