# difference between classification and regression in machine learning

Understanding the key difference between classification and regression will helpful in understanding different classification algorithms and regression analysis algorithms. The idea of this post is to give a clear picture to differentiate classification and regression analysis. Both classification and regression algorithms are supervised learning algorithms. You can study more about supervised and unsupervised learning from previous posts.

**Classification**

The main goal of classification is to predict the target class (Yes/ No). If the trained model is for predicting any of two target classes. It is known as binary classification. Considering the student profile to predict whether the student will pass or fail. Considering the customer, transaction details to predict whether he will buy the new product or not. These kind problems will be addressed with binary classification. If we have to predict more the two target classes it is known as multi-classification. Considering all subject details of a student to predict which subject the student will score more. Identifying the object in an image. These kind problems are known as multi-classification problems.

**Regression**

The main goal of regression algorithms is the predict the discrete or a continues value. In some cases, the predicted value can be used to identify the linear relationship between the attributes. Suppose the increase in the product advantage budget will increase the product sales. Based on the problem difference regression algorithms can be used. some of the basic regression algorithms are linear regression, polynomial regression … etc

**Classification and Regression difference with an example**

**Classification Example:**

Suppose from your past data ( **train data** ) you come to know that your best friend likes the above movies. Now one new movie ( **test data** ) released. Hopefully, you want to know your best friend like it or not. If you strongly confirmed about the chances of your friend like the move. You can take your friend to a movie this weekend.

If you clearly observe the problem it is just whether your friend **like or not. **Finding a solution to this type of problem is called as **classification.** This is because we are classifying the things to their belongings **(yes or no, like or dislike ). **Keep in mind here we are forecasting **target** class( classification ) and the other thing this classification belongs to **Supervised learning. **This is because you are **learning** this from your **train data.**

In this case, the problem is a **binary classification** in which we have to predict whether output belongs to class 1 or class 2** (class 1 : yes, class 2: no ). ** As we have discussed earlier we can use classification for predicting more classes too. Like **(Color Prediction: RED,GREEN,BLUE,YELLOW,ORANGE)**

**Regression Example:**

Suppose from your past data ( **train data** ) you come to know that your best friend likes the above movies. You also know how many times each particular movie seen by your friend. Now one new movie **( test data )** released. Now your are going to find how many times this newly released movie will your friend watch. It could be 5 times, 6 times,10 times etc…

If you clearly observe the problem is about finding the **count**, sometimes we can say this as **predicting the value. **Keep in mind, here we are forecasting a **value** ( Prediction ) and the other thing this prediction also belongs to **Supervised learning. **This is because you are **learning** this from you **train data.**

**Summary**

- If forecasting
**target**class ( Classification ) - If forecasting a
**value**( Regression )

#### Follow us:

**FACEBOOK| QUORA |TWITTER| GOOGLE+ | LINKEDIN| REDDIT | FLIPBOARD | MEDIUM | GITHUB**

I hope you like this post. If you have any questions then feel free to comment below. If you want me to write on one specific topic then do tell it to me in the comments below.

How i can difference between classify tree and Regression tree in SPSS?

Hi Safia,

We haven’t worked on any SPSS(statistical software). To address your questions I would suggest you, check out the difference between the classification and the regression article.

Can you explain me difference between Discrete data values and Continuous data values with examples?

Hi,

Discrete data values can only take certain values. For example you will have certain number of friends like 4 or 5 but you can’t have 4.5(4 and half) friends. So These type of data values are called as discrete. weight of some object, height of the person these type of data are called as Continuous data.