Classification vs Regression in ML

Ashish Upadhyay
2 min readJun 7, 2021

Understanding Classification and Regression in Machine learning.

Photo by Joao Branco on Unsplash

Some days ago, I talked with a Data scientist, who works at a good corporate company. As I am trying to get a job in the data science field, I asked him to help me. Then, He asked me a question — “What are Classification and Regression?”. I did tell him the answer but he told me that answer is wrong. I was shocked and baffled at the same time but I found out that the answer was not appropriate to qualify for an interview. That is why I decided to find an appropriate answer to that question and in this post, I am gonna tell you the answer to that question.

Classification

In machine learning, Classification is a supervised modeling problem where we label or assign a data point to a class/group. The label assigned must be in the target value of that problem.

Examples of Classification problems are — “spam and not-spam”, “handwriting recognition”, “word classification”, “image classification”, “document classification”, “finite discrete target value” etc.

Classification problems can be solved by different ML algorithms such as — LogisticRegression, RandomForestClassifier, DecisionTreeClassifier, Naive Bayes, XGBClassifier, SVC, and ANN, etc.

Regression

Regression is also a supervised technique in which we predict a continuous target variable (y) for some features (x) of the dataset using different ML algorithms. In other words, we try to map the target value (y) into a mathematical equation of features (x).

Examples of Regression problems are — “house price prediction”, “test marks prediction”, “weight prediction”, “height prediction”, “salary prediction” etc. Time Series is also a type of Regression that I will talk about in my next post.

Regression problems can be solved by different ML algorithms such as — LinearRegression, RandomForestRegressor, DecisionTreeRegressor, XGBRegressor, SVR, and ANN, etc.

I hope that I am able to give you an answer to that question which I asked you early in the post.

As this is my first post, I hope you excuse any grammatical error and I also appreciate any feedback on this post.

--

--

Ashish Upadhyay

A student of Computer Science engineering and an enthusiastic data scientist.