Supervised, unsupervised and reinforcement learning

Mehtapriyankapm
9 min readNov 15, 2020

--

Photo by Andy Kelly on Unsplash

Hey folks

As we all know that the technological advancements are taking place and world is getting digitalized in every sense of the word. It is very important to explore one of its key terms i.e. machine learning.

Machine Learning is an application of artificial intelligence that basically provides system the ability to learn, improve from experience and predict things without any human intervention or assistance. With the help of sample past data, which is known as training model, machine learning algorithms build a mathematical model that helps machines in making predictions or decisions without any human intervention. The model makes prediction on the new data, which is the test or validation data.

It is an undeniable fact that machine learning has brought vast improvement to the world since its introduction. Various applications of machine learning include a variety of range from insights to recommendations to predictions on running the business better.

The machine learning algorithms can be broadly categorized as:

1. Supervised Learning

2. Unsupervised Learning

3. Reinforcement Learning

A major issue that seems to hinder the growth and learning of individuals who are beginning their journey in this field is the difference between supervised, unsupervised algorithms and reinforcement learning. The newcomers tend to mix these up, so I thought I would write about it. In this blog, I have tried to explain the meaning of each, with the help of examples, discussing the difference between them and tackling some of the misconceptions around them.

Let’s get going!

WHAT IS SUPERVISED LEARNING?

Supervised Learning as the name suggests the presence of supervision. In this type of machine learning the machines predict the output on the basis of the “labelled“ training data. The labelled data means some input data is already appended with the correct output. The training data given to the machines work as the supervisor that teaches the machines to predict the output correctly. The goal of supervised learning is to get the output data from the input data

There are two categories of supervised learning:

  1. Classification — The aim of such algorithms is to find a mapping function to map the input variable(x) with the DISCRETE output variable(y).
  2. Regression — The aim of such algorithms is to find a mapping function to map the input variable(x) with the CONTINUOUS output variable(y).

EXAMPLE OF SUPERVISED LEARNING

Suppose you have a younger brother who has just turned 2 years old and is learning to speak. You want to teach him what a banana and an apple is. So, what will you do? You will either show him pictures of apples and bananas or you bring an apple and a banana and show them to him in real-life so that he can understand the difference.

Now in addition there are certain things you tell him so that he understands the differences between the 2 fruits.

  • Banana and apple both are fruits.
  • Apple is red in color.
  • Banana is yellow in color.
  • The shape of apple is round.
  • The shape of banana is not round and it has a curvy shape.

Now after few hours, to test if he has understood the difference between the two you will show him the pictures of apples and bananas. If he is able to differentiate between the two, you have successfully taught him.

What happened here?

You acted as a supervisor who was there to guide him to the goal of differentiating between an apple and banana. You taught him every difference between the two fruits and then tested his understanding. If he was able to learn, he called the apple as an apple and the banana as a banana. If he was not able to, you taught him more. As stated, before you acted as the supervisor and your brother acted as the algorithm that had to learn. That is the principle that Supervised Learning follows.

Did you see how supervised learning helped you in real life. In addition to this it has various advantages in the field of machine learning. Let us move to that now and will be also discussing about its disadvantages

ADVANTAGES OF SUPERVISED LEARNING

  1. It allows collecting data and producing the output from the previous experiences.
  2. It helps to improve performance criteria with the help of experience.
  3. It helps to solve various types of real-world computation problems.
  4. The results produced by the supervised method are considered to be more accurate and reliable in comparison to the results produced by other techniques of machine learning.

DISADVANTAGES OF SUPERVISED LEARNING

  1. The computation time of training the model is high.
  2. One needs to select a lot of good examples from each class while he/she is training the model.

APPLICATIONS OF SUPERVISED LEARNING

Some of it’s important application are:

  1. Speech recognition
  2. Fraud detection
  3. Spam detection
  4. Image classification

WHAT IS UNSUPERVISED LEARNING?

Unsupervised Learning as the name suggests presence of no supervision. In this type of machine learning machines are trained using training data that is not “labelled”. The objective of unsupervised learning is to restructure the input data into new features or a group of objects with similar patterns.
In unsupervised learning, we do not have a predetermined result. The machine tries to find useful inferences from the huge amount of data.

There are two categories of unsupervised learning:

  1. Clustering — Clustering is a method of grouping similar data items into clusters. It determines the similarities between the data items and categorizes them as per the presence and absence of those similarities.
  2. Association — This algorithm is based on finding associations among data items in a large dataset. It determines which data items come together in the dataset.

EXAMPLE OF UNSUPERVISED LEARNING

Suppose you are a die-hard cricket fan. Now one of your friends has asked you to join him at his house for watching a football match between Barcelona and Real Madrid. You have no idea about what football is but just for your friends, you say yes and head over to his house. The match starts and you sit there with no idea with what is going on in the match. Your friends are enjoying the way Lionel Messi plays and want you to join in the fun. Here is when you try to learn about the game. You examine the screen and come up with certain conclusions that you can use to understand the game better.

• There are 2 teams with jerseys of different color combinations. One which has the color combination red-blue and other with white color. Since the last goal was scored by Messi and you saw an update in the score of Barcelona you conclude that the jersey of red-blue belongs to Barcelona and the white jersey belongs to Real Madrid.

• You can see that on the ground there are total of 11 players from each team and out of the 11, 1 player is near the goal, preventing the opponent team member from scoring, making him a goalkeeper and the remaining 10 players are on the field trying to goal in the other’s goal, making them the outfield players.

• If the ball passes over the goal line the team gets few points.

• Messi has a number 10 on his back and his name is written on the back of his t-shirt and if he or any of his fellow team players hits the goal, you need to cheer

• If the opponent team hits a goal you need to show your disappointment.

You make these observations one-by-one and you know when to do what. From knowing nothing to knowing the basics of football, you can now enjoy the match with your friends, without them knowing that you did not know anything.

What happened here?

You had every material that you needed to learn about the basics of football- TV, when and who your friends cheer for. This made you learn about football all by yourself without someone guiding you about anything. This is the principle that unsupervised learning follows.

Did you see how unsupervised learning helped you in real life. In addition to this it has various advantages in the field of machine learning. Let us move to that now and will be also discussing about its disadvantages

ADVANTAGES OF UNSUPERVISED LEARNING

  1. It makes the machine tackle problems that humans might find difficult either due to a limited capacity or a bias.
  2. It is ideal for exploring raw and unknown data.

DISADVANTAGES OF UNSUPERVISED LEARNING

  1. The results produced by the unsupervised method are considered to be less accurate and reliable in comparison to the results produced by other techniques of machine learning.
  2. The user needs to spend time interpreting and labelling the groups/classes which are formed as result.

APPLICATIONS OF UNSUPERVISED LEARNING

Some of it’s important application are:

  1. Content Recommendation
  2. Image segmentation
  3. Credit card fraud detection
  4. Social network analysis

WHAT IS REINFORCEMENT LEARNING?

Reinforcement learning is a feedback-based learning method. The machine gets either rewards or penalties for the actions it performs. It gets reward for each right action and penalty for each wrong action. The machine interacts with its environment, explores it and performs actions and learn from the feedback. The goal of an agent is to get the maximum reward points and wherefore improve its performance.

There two categories of reinforcement learning are:

  1. Positive Reinforcement — It is defined as an event which occurred due to a particular behavior and its occurrence increases the strength and frequency of the behavior. In other words, it has a positive impact on behavior.
  2. Negative Reinforcement — It is defined as strengthening of a behavior because a negative condition has been avoided.

EXAMPLE OF REINFORCEMENT LEARNING

Suppose you have a 5-year-old son, and you want to build skill behaviors in your child. This can be done through reinforcement of the behavior which means to get the child to do more of a desired behavior or skill behavior. What you do is you give him a reward like chocolate gem whenever he performs the desired behavior. Whenever he performs a maladaptive practice you ask him to pay fine and as a result, he does not get his chocolate gem.

So, when the child notices that every time he performs a skill behavior for e.g. performing homework on time he gets a chocolate gem as a reward he automatically after few trials will start learning what behavior is rewarding for him. So, he would gradually increase it and decrease the likelihood of not performing that behavior. He will also take care of the things that he doesn’t need to do e.g. not eating green vegetables as for doing so he will have to pay a fine.

What happened here?

For developing the skills of your child, you used rewards and penalties as signals for positive and negative behavior, respectively. In response, your child in order to increase his cumulative reward tried to avoid bad behavior and did suitable actions only. This is the principle that reinforcement Learning follows.

Did you see how reinforcement learning can help one in real life. In addition to this it has various advantages in the field of machine learning. Let us move to that now and will be also discussing about its disadvantages

ADVANTAGES OF REINFORCEMENT LEARNING

1. Reinforcement learning can be used to solve very complex problems that cannot be solved by conventional techniques.

2. This technique is preferred to achieve long-term results, which are very difficult to achieve.

3. The model can correct the errors that occurred during the training process.

DISADVANTAGES OF REINFORCEMENT LEARNING

1. It is usually not preferred to solve simpler problems

2. It needs a lot of data and a lot of computation.

APPLICATIONS OF REINFORCEMENT LEARNING

Some of it’s important application are:

  1. Game-playing — It is very handy in games like Chess, Go, etc.
  2. Robotics
  3. Self driving cars
  4. Industrial automation

Did you find this article helpful? Please share your opinions/thoughts in the comments section.

Happy Machine Learning :)

--

--