An Introduction to Supervised Learning

Anmol Sharma

8 months ago

An Introduction to Supervised Learning | insideAIML
Table of Content
  • Introduction
  • What is Supervised learning?
  • How Supervised learning works?
  • Types of Supervised learning problems
  • Difference between Supervised and Unsupervised learning
  • Summary


         Machine learning is one of the top technologies at present. It has gained a lot of audience in recent years. The reason behind this hype about Machine learning is that it can solve almost every type of problem in different fields. It is a very broad field with a large number of types, techniques, algorithms and tools that make Machine learning solve a huge range of problems. In this article, we are going to discover about Supervised learning which is one of the types of Machine learning. So, let’s get started.

What is Supervised learning?

          Supervised machine learning is the most popular type of Machine learning. In supervised learning, the model learns from labelled data and predicts the output for unlabeled data.
For example: Suppose you show a kid 5 different fruits and tell him/her their names. Now, the kid will try to find some connection/relationship between those fruits and their names. Say he might remember mango as a yellow fruit. Now the next time you will show him the fruits he will try to identify their names by any kind of relationship he has discovered like yellow for mango. Here the kid learned from the labelled data such that he discovered a relationship between features(fruits) and their labels(fruit name) and predicted the output for the unlabeled data.
Price prediction, fraud detection, spam filtering are some of the common applications of supervised learning.

How Supervised Learning works?

         A supervised learning model is a training based model where the model is first trained on data and then predicts the output for similar kinds of unseen data. During its training phase, the program is provided with labelled data sets, which teach the system what output is related to each input value. Then, the trained model is fed with test data. Test data contains the output labels but they are not exposed to the model. The purpose of test data is to measure how accurately the algorithm will work on unlabeled data.
Take a look at the picture below.
Supervised learning in  Machine Learning | insideAIML

Types of Supervised learning problems

         Supervised learning is used for solving two types of problems and they are:
  • Regression
  • Classification


         Regression is a supervised machine learning technique. It is a mathematical formula that balances relationships between dependent and independent variables. It tells us that the number of variables depends on it changes where the value of the variance varies. Relationships are established with well-defined line support (y = mx + c; line balance). It helps to predict the numeric value. The regression model will predict the Y value of the given X values.
Regression Equations:
1. Y = bo + b1X + e (Simple Linear Regression)
2. Y = bo + b1X1 + b2X2 + ... + e (Multiple Variable Linear Regression)
Here, Y -> Dependent Variable
X,X1,X2,...,Xn -> independent Variables
bo -> Intercept of line
b1,b2,...,bn -> slopes of line
e -> error
Example: Suppose you have to predict the value of a house and the variables you have are-
house_price, house_size, house_condition, and house_neighborhood. Here, house_price is the
dependent variable, and the rest of the variables are independent because house_price
depends upon the rest.
The regression equation of this problem will look like as:
house_price = bo + b1*house_size + b2*house_condition + b3*house_neighborhood + e
Common regression algorithms: 
  • Linear Regression
  • Polynomial Regression
  • Elastic Net Regression
  • Naive Bayes(Bayesian linear regression)
  • Decision/Regression Trees


         It is also a supervised ML technique. It is a technique that identifies that the given examples fall
under which category. In classification, the output/prediction/dependent variable(Y) is
categorical, and the interdependent variables(Xn) can be numerical and categorical.
Example: We have a dataset of emails and we have to classify them as spam or not spam.
Here, the Y(output) is a categorical variable i.e spam or not spam, and X(input variable) can be
both categorical and numeric say email_sender(C), email_frequency(N).
Take a look at the image below.
Classification | insideAIML
Common classification algorithms:
  • Logistic Regression algorithm
  • SVM
  • KNN
  • Random Forest 

Difference between Supervised and Unsupervised learning

          The major difference between supervised and unsupervised learning is that in supervised learning, the model is trained using labeled data i.e. inputs and outputs are provided. On the other hand, in unsupervised learning, the model is trained using unlabeled data and is allowed to work on unlabeled data without guidance that the model is provided with input features only.
Supervised learning solves regression and classification problems while unsupervised learning solves clustering and association analysis problems.


          In this article, we learned about supervised learning, its working, types: classification and regression and the difference between supervised and unsupervised learning. There are a number of algorithms used for solving supervised learning problems. Some common algorithms are linear regression, polynomial regression, logistic regression algorithm, Bayesian linear regression, regression trees, SVM and KNN. We encourage you to discover these algorithms to master supervised learning.
We hope you gain an understanding of supervised learning. Do reach out to us for queries on our, AI-dedicated discussion forum and obtain your query resolved within a half-hour.
Like the Blog, then Share it with your friends and colleagues to make this AI community stronger. 
To learn more about nuances of Artificial Intelligence, Python Programming, Deep Learning, Data Science and Machine Learning, visit our insideAIML blog page.
Keep Learning. Keep Growing.

Submit Review