Types of learning in machine learning explained
Learning in the domain of machine learning is predominantly seen as in 4 buckets or types. Yes, there are 4 types of learning and in this article I will go through each one in a brief manner. For starters, the types of learning are:
- Supervised Learning
- Unsupervised Learning
- Semi supervised Learning
- Reinforcement Learning
Supervised Learning
Explanation
Supervised learning basically deals with labelled data. For example, let us say you have a flower species dataset in which you have flower characteristics (or features) like length of petal, length of sepal, width of petal and width of sepal and then you have an associated label (or target) which is the species of the flower. (This dataset can be found here.)
The main point here is that the data is in the form of (X,y) where X is the set of input features (petal length, sepal length, petal width and sepal width) and y is the target which is flower species in this case. In supervised learning, the target is known for the training data and you need to build a model using this training data which can predict the target (y) for unknown data where only the input features (X) are available.
Furthermore, the target variable y can either be discrete or continuous. "Discrete" means discrete classes as in flower species or types of animals (dog, cat, wolf, etc.,). "Continuous" means that the target is a numerically ordered value like the price of a house. In supervised learning, if the target is discrete, it is called "Classification" and if the target is "continuous", it is called "Regression".
Why is supervised learning called so?
Supervised learning is called "supervised" learning because the whole training process happens under the supervision of the target variable or label. What does this mean? If you are aware of the model training process, it means that the model will predict the target value and then the label will supervise it to see if it is the correct label by comparing it to itself. If it is not, then this feedback will go to the training process for the next iteration and doing so in successive iterations, you will get a model with high prediction accuracy (which is why you have a no of iterations hyperparameter in ML library functions). You can think of it as having the solution key (label) for a question set with which you can compare your answers (predicted labels) after solving and then improve upon them in the training process.
Supervised learning |
Summary:
- Supervised learning deals with labelled data.
- Labelled data is in the form of (X,y) where X denotes input features and y denotes target variable.
- Aim is to train a model on this labelled data (X,y) so that it can predict unknown target y for some data X
- Furthermore, supervised learning consists of 2 tasks: classification and regression
- When the target y is discrete, it is called classification task.
- When the target y is continuous, it is called regression task.
Unsupervised Learning
Explanation
Contrary to supervised learning, unsupervised learning deals with unlabelled data i.e., the data without any label or target. Unlabelled data means just X (set of input features) and no y (no target). Unsupervised learning is basically used to find patterns and form clusters in the available unlabelled dataset.
Why is Unsupervised learning called so?
Unsupervised learning is called "unsupervised" learning because unlike supervised learning there is no target feature which can supervise the correctness of the model process. You can think of it as giving an exam where the solution key to the questions is not available with you (so no supervision).
Unsupervised learning |
Summary
- Unsupervised learning deals with unlabelled data.
- The aim is to find patterns and cluster the unlabelled data.
- K means clustering is a popular algorithm in this field.
Semi-supervised Learning
Explanation
Semi-supervised learning, as the name suggests, is a mixture of supervised and unsupervised learning. Basically, when you have a lot of data, but only a portion of that data is labelled and the rest is unlabelled, you can use the labelled data to infer the labels for the unlabelled data based on distance or something like that.
Why is semi supervised learning called so?
Semi-supervised learning is called "semi-supervised" because only a small portion of the data is labelled. So there is supervision but only weak or "semi" because of semi-labelled data.
Summary
- Semi supervised learning deals with partially labelled datasets.
- It is a combination of supervised and unsupervised learning.
- An example could be pseudo labelling.
Reinforcement Learning
Explanation
In reinforcement learning, there is an agent in an environment and the agent takes some action and the environment rewards or punishes the agent, also sending it to a new state, thereby reinforcing certain behaviours of the agent which maximize its long term rewards (pretty similar to how humans act and learn when placed in a new environment).
Why is reinforcement learning called so?
The term "reinforcement" comes from behavioural psychology which basically means consequence of an action that strengthens certain behaviours of the organism (agent in this case). In reinforcement learning, we try to reinforce actions so as to maximize the long term rewards of the agent using some reward/punishment mechanism and that is why it is called so (similar to how your parents might reward you if you get good grades, and might punish you if you fail in hopes of reinforcing good habits in you).
Reinforcement learning |
Summary
- Involves an agent acting in an environment which receives rewards or punishments according to its actions and these rewards/punishments shape its further trajectory of operation.
- Similar to how most schools operate in the present world where you get rewarded for good grades and punished for bad grades so as to direct your behaviour towards good grades.