Supervised Learning and Its Types

Supervised Learning and Its Types

Learn how supervised learning operates, how machine learning models are trained with labeled data, and how classification differs from regression.

Series: Attention because it's all you need. (14 articles)

  1. …
  2. 9
    Supervised Learning and Its Types This article
Machine Learning Engineer | Frontend Developer | Deep Learning & Generative AI | RAG, MLOps & AWS

What Is Supervised Learning?

Machine learning is all about learning patterns from data. One of the basic methods of doing that is called supervised learning. But what does the term "supervised" mean? Let us consider an example. To teach a child recognizing cats and dogs, you need to show them pictures and tell which one is a cat and which one is a dog. In some time, they start recognizing the patterns and distinguishing animals that they never saw before.
Supervised learning is quite the same. We provide a model with examples consisting of inputs and correct outputs called features and labels, and it learns the relation between them and starts making predictions on new examples. For instance, a set of houses containing their sizes, locations, and prices would allow a model to predict the price of another house. Or a set of emails labeled as spam or not spam would be useful for classification of incoming messages. The key point is that the model learns from examples with already existing answers.

What Are the Types of Supervised Learning?

Generally, there are two types of supervised learning regression and classification.
  1. Regression
Regression is used when we want to make a prediction of some number. For example, predict a price of a house, temperature, salary, number of future sales, etc. From examples with labeled answers, a model learns to predict a numerical output based on input features. Popular algorithms: Linear Regression, Polynomial Regression, Decision Tree Regression, and Random Forest Regression.
  1. Classification
Classification is applied when we want to predict a class or a category. For instance, we might need to find out whether an email is spam or not, to predict whether a transaction is fraudulent or not, or to recognize a cat or a dog in the picture. It can be done by using binary classification, when there are two categories only, or multiclass classification with more categories. Popular algorithms: Logistic Regression, Decision Trees, Random Forests, Support Vector Machines, Naive Bayes.

How Does a Supervised Learning Model Learn?

During the training, a model produces some predictions based on the current values of its parameters. Then the predictions are compared with the actual labels using the right loss function that calculates the distance from the predicted outputs to the expected ones. The learning algorithm changes the parameters in such a way that the error becomes smaller. And this process repeats until the model learns useful patterns from the training data. But producing accurate predictions on the training data does not guarantee good performance on the new data. This is why we should check the performance of the model using new data.

Why Is Supervised Learning So Popular?

Many real-life problems deal with prediction of some known answer on the basis of the historical data. That is why supervised learning is very popular and widely-used. Knowing about regression and classification helps to understand how individual algorithms work, choose evaluation metrics, analyze performance of the model, and move to other Machine Learning techniques. And the aim is not just to train a model and get some predictions, but to understand what a model learned, how it learned and whether its predictions are trustworthy on unseen data.

Series: Attention because it's all you need. (14 articles)

  1. …
  2. 9
    Supervised Learning and Its Types This article
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article