Member-only story

Interview question: What is the difference between regression and classification?

Crystal X
3 min readJan 23, 2024

--

I have been studying machine learning for close to four years now and one thing that has been firmly imprinted into my training is that in supervised machine learning, there are two different types of models, being regression and classification.

Regression

Regression algorithms predict continuous value from the provided input. A supervised learning algorithm uses real values to predict quantitative data like income, height, weight, scores or probability. Machine learning engineers and data scientists mostly use regression algorithms to operate distinct labelled datasets while mapping estimations. Many regression problems involve predicting prices or salaries.

Perhaps one of the simplest regression algorithms is linear regression. In statistics, linear regression is a statistical model that estimates the linear relationship between a scalar response and one or more explanatory variables (also known as dependent and independent variables).

The formula for simple linear regression is:-

The data as it appears against the regression line can be seen in the diagram below:-

The code in Python to compute simple linear regression can be seen below:-

--

--

Crystal X
Crystal X

Written by Crystal X

I have over five decades experience in the world of work, being in fast food, the military, business, non-profits, and the healthcare sector.

Responses (2)