PRO 30% Free • Stripe ($15) & Razorpay (₹899)

Regression vs. Classification

Top Course Staff · 2 min read · Machine learning · PRO · 30% Free Preview Available

Regression vs. Classification

Machine Learning is a set of many different techniques that are each suited to answering different types of questions.

One way of categorizing machine learning algorithms is by using the kind output they produce. In terms of output, two main types of machine learning models exist: those for regression and those for classification.

Regression

Regression is used to predict outputs that arecontinuous. The outputs are quantities that can be flexibly determined based on the inputs of the model rather than being confined to a set of possible labels.

For example:

  • Predict the height of a potted plant from the amount of rainfall
  • Predict salary based on someone’s age and availability of high-speed internet
  • Predict a car’s MPG (miles per gallon) based on size and model year
Regression GIF

Regression GIF

Linear regression is the most popular regression algorithm. It is often underrated because of its relative simplicity. In a business setting, it could be used to predict the likelihood that a customer will churn or the revenue a customer will generate. More complex models may fit this data better, at the cost of losing simplicity.

Classification

Classification is used to predict adiscrete label. The outputs fall under a finite set of possible outcomes. Many situations have only two possible outcomes. This is calledbinary classification(True/False, 0 or 1,/ not).

Hotdog

Hotdog

  • Predict whether an email is spam or not
  • Predict whether it will rain or not
  • Predict whether a user is a power user or a casual user

There are also two other common types of classification:multi-class classificationandmulti-label classification.

Multi-class classification has the same idea behind binary classification, except instead of two possible outcomes, there are three or more.

  • Predict whether a photo contains a pear, apple, or peach
  • Predict what letter of the alphabet a handwritten character is
  • Predict whether a piece of fruit is small, medium, or large
Classification GIF

Classification GIF

An important note about binary and multi-class classification is that in both, each outcome has one specific label. However, in multi-label classification, there are multiple possible labels for each outcome. This is useful for customer segmentation, image categorization, and sentiment analysis for understanding text. To perform these classifications, we use models like Naive Bayes, K-Nearest Neighbors, SVMs, as well as variousdeep learningmodels.

An example of multi-label classification is shown below. Here, a cat and a bird are both identified in a photo showing a classification model with more than one label as a result.

classification model identifying a cat and a bird in an outdoor photo

classification model identifying a cat and a bird in an outdoor photo

Choosing a model is a critical step in theMachine Learning process. It is important that the model fits the question at hand. When you choose the right model, you are already one step closer to getting meaningful and interesting results.

'The Codecademy Team, composed of experienced educators and tech experts, is dedicated to making tech skills accessible to all. We empower learners worldwide with expert-reviewed content that develops and enhances the technical skills needed to advance and succeed in their careers.'

30% Free Preview Reached · Unlock Remaining 70%

Complete Payment to Unlock Full Guide & Source Code

You are viewing the 30% preview. Join TopCourseAI Pro to unlock the remaining 70% of this article, unblur all code snippets, and gain full access to all 412 technical projects and guides.

✓ Full Access to All 160+ Projects
✓ Instant Blur Removal Everywhere
✓ Production Source Code & Blueprints
✓ All Future Deep Dives Included
Instant Unhindered Activation ·
End of Preview · Unlock Complete Blueprint & Source Code

Ready to access the complete step-by-step tutorial?

Gain full unhindered access to all 412 technical projects and guides, unblur all source code snippets, and download runnable scripts.

Production AI Blueprints

Ready to build production-grade AI systems?

Enjoyed this guide? Continue exploring our library of 166+ production blueprints, multi-agent swarms, and autonomous agent systems with 100% unblurred, executable source code.