This Tutorial Explains The Types of Machine Learning i.e. Supervised, Unsupervised, Reinforcement & Semi-Supervised Learning With Simple Examples. You Will Also Learn Differences Between Supervised Vs Unsupervised Learning:
In the Previous Tutorial, we have learned about Machine Learning, its working, and applications. We have also seen a comparison of Machine Learning Vs Artificial Intelligence.
Machine Learning is a field of science that deals with computer programs learning through experience and predicting the output.
The main feature of ML is learning from experience. The learning happens when the system fed with training input data makes changes in its parameters and adjusts itself to give the desired output. The output is the target value defined in the training data.
What You Will Learn:
- Types Of Machine Learning
- Real-Life Example Of Supervised And Unsupervised Learning
- Difference Between Supervised Vs Unsupervised Learning
- Semi-Supervised Learning
Types Of Machine Learning
Machine Learning programs are classified into 3 types as shown below.
- Reinforcement Learning
Let us understand each of these in detail!!
#1) Supervised Learning
Supervised learning happens in the presence of a supervisor just like learning performed by a small child with the help of his teacher. As a child is trained to recognize fruits, colors, numbers under the supervision of a teacher this method is supervised learning.
In this method, every step of the child is checked by the teacher and the child learns from the output that he has to produce.
How Supervised Learning Works?
In the supervised ML algorithm, the output is already known. There is a mapping of input with the output. Hence, to create a model, the machine is fed with lots of training input data (having input and corresponding output known).
The training data helps in achieving a level of accuracy for the created data model. The built model is now ready to be fed with new input data and predict the outcomes.
What Is a Labeled Dataset?
The dataset with outputs known for a given input is called a Labeled Dataset. For example, an image of fruit along with the fruit name is known. So when a new image of fruit is shown, it compares with the training set to predict the answer.
Supervised learning is a fast learning mechanism with high accuracy. The supervised learning problems include regression and classification problems.
Some of the supervised learning algorithms are:
- Decision Trees,
- K-Nearest Neighbor,
- Linear Regression,
- Support Vector Machine and
- Neural Networks.
Example Of Supervised Learning
- In the first step, a training data set is fed to the machine learning algorithm.
- With the training dataset, the machine adjusts itself, by making changes in the parameters to build a logical model.
- The built model is then used for a new set of data to predict the outcome.
Types Of Supervised Learning Algorithms
- Classification: In these types of problems, we predict the response as specific classes, such as “yes” or “no”. When only 2 classes are present, then it is called a Binary Classification. For more than 2 class values, it is called a Multi-class Classification. The predicted response values are discrete values. For example, Is it the image of the sun or the moon? The classification algorithm separates the data into classes.
- Regression: Regression problems predict the response as continuous values such as predicting a value that ranges from -infinity to infinity. It may take many values. For example, the linear regression algorithm that is applied, predicts the cost of the house based on many parameters such as location, nearby airport, size of the house, etc.
#2) Unsupervised Learning
Unsupervised learning happens without the help of a supervisor just like a fish learns to swim by itself. It is an independent learning process.
In this model, as there is no output mapped with the input, the target values are unknown/unlabeled. The system needs to learn by itself from the data input to it and detect the hidden patterns.
What Is Unlabeled Dataset?
A dataset with unknown output values for all the input values is called an unlabeled dataset.
How Unsupervised Learning Works?
As there are no known output values that can be used to build a logical model between the input and output, some techniques are used to mine data rules, patterns and groups of data with similar types. These groups help the end-users to understand the data better as well as find a meaningful output.
The fed inputs are not in the form of a proper structure just like training data is (in supervised learning). It may contain outliers, noisy data, etc. These inputs are together fed to the system. While training the model, the inputs are organized to form clusters.
The unsupervised learning algorithms include Clustering and Association Algorithms such as:
- K-means clustering and other association rule mining algorithms.
When new data is fed to the model, it will predict the outcome as a class label to which the input belongs. If the class label is not present, then a new class will be generated.
While undergoing the process of discovering patterns in the data, the model adjusts its parameters by itself hence it is also called self-organizing. The clusters will be formed by finding out the similarities among the inputs.
For Example, while buying products online, if butter is put in the cart, then it suggests buying bread, cheese, etc. The unsupervised model looks at the data points and predicts the other attributes that are associated with the product.
Example Of Unsupervised Learning
Types Of Unsupervised Algorithms
- Clustering Algorithm: The methods of finding the similarities between data items such as the same shape, size, color, price, etc. and grouping them to form a cluster is cluster analysis.
- Outlier Detection: In this method, the dataset is the search for any kind of dissimilarities and anomalies in the data. For example, a high-value transaction on credit card is detected by the system for fraud detection.
- Association Rule Mining: In this type of mining, it finds out the most frequently occurring itemsets or associations between elements. Associations such as “products often purchased together”, etc.
- Autoencoders: The input is compressed into a coded form and is recreated to remove noisy data. This technique is used to improve image, and video quality.
#3) Reinforcement Learning
In this type of learning, the algorithm learns by feedback mechanism and past experiences. It is always desired that each step in the algorithm is taken to reach a goal.
So whenever the next step is to be taken, it receives the feedback from the previous step, along with the learning from the experience to predict what could be the next best step. This process is also called a trial and error process to reach the goal.
Reinforcement learning is a long term iterative process. The more the number of feedbacks, the more accurate the system becomes. Basic reinforcement learning is also called Markov Decision Process.
Example Of Reinforcement Learning
Example of Reinforcement Learning is video games, where the players complete certain levels of a game and earn reward points. The game provides feedback to the player through bonus moves to improve his/her performance.
Reinforcement Learning is used in training robots, self-driven cars, automatic management of inventory, etc.
Some popular algorithms of Reinforcement Learning include:
- Deep Adversarial Networks
- Temporal Difference
The figure below describes the feedback mechanism of Reinforcement Learning.
- The input is observed by the agent which is the AI element.
- This AI agent acts on the environment according to the decision made.
- The response of the environment is sent to the AI in the form of a reward back as feedback.
- State and action performed on the environment are also saved.
Real-Life Example Of Supervised And Unsupervised Learning
For Supervised Learning:
#1) Let us take an example of a basket of vegetables having onion, carrot, radish, tomato, etc., and we can arrange them in the form of groups.
#2) We create a training data table to understand Supervised Learning.
The training data table characterizes the vegetables based on:
When this training data table is fed to the machine, it will build a logical model using the shape, color, size of the vegetable, etc., to predict the outcome (vegetable).
As a new input is fed to this model, the algorithm will analyze the parameters and output the name of the fruit.
For Unsupervised Learning:
In unsupervised learning, it creates groups or clusters based on attributes. In the above sample dataset, the parameter of vegetable are:
The vegetables are grouped based on shape.
- Round: Onion and Tomato.
- Cylindrical: Radish and Carrot.
Take another parameter such as size.
The vegetables are grouped based on size and shape:
- Medium Size and Round Shape: Tomato
- Big Size and Round Shape: Onion
In unsupervised learning, we do not have any training dataset and outcome variable while in supervised learning, the training data is known and is used to train the algorithm.
Difference Between Supervised Vs Unsupervised Learning
|In supervised learning algorithms, the output for the given input is known.||In unsupervised learning algorithms, the output for the given input is unknown.|
|The algorithms learn from labeled set of data. This data helps in evaluating the accuracy on training data.||The algorithm is provided with unlabeled data where it tries to find patterns and associations in between the data items.|
|It is a Predictive Modeling technique which predicts the future outcomes accurately.||It is a Descriptive Modeling technique which explains the real relationship between the elements and history of the elements.|
|It includes classification and regression algorithms.||It includes clustering and association rules learning algorithms.|
|Some algorithms of supervised learning are Linear Regression, Naïve Bayes, and Neural Networks.||Some algorithms for unsupervised learning are k- means clustering, Apriori, etc.|
|This type of learning is relatively complex as it requires labelled data.||It is less complex as there is no need to understand and label data.|
|It is more accurate than unsupervised learning as input data and corresponding output is well known, and the machine only needs to give predictions.||It has less accuracy as the input data is unlabeled. Thus the machine has to first understand and label the data and then give predictions.|
|It is an online process of data analysis and does not require human interaction.||This is a real time analysis of data.|
The semi-supervised learning approach takes both labeled and unlabeled training data input. This type of learning is useful when it is difficult to extract useful features from unlabeled data (supervised approach) and data experts find it difficult to label the input data (unsupervised approach).
Only a small amount of labeled data in these algorithms can lead to the accuracy of the model.
Examples of semi-supervised learning include CT scans and MRI’s where a medical expert can label a few points in the scans for any disease while it is difficult to label all the scans.
The machine learning tasks are broadly classified into Supervised, Unsupervised, Semi-Supervised and Reinforcement Learning tasks.
Supervised learning is learning with the help of labeled data. The ML algorithms are fed with a training dataset in which for every input data the output is known, to predict future outcomes.
This model is highly accurate and fast, but it requires high expertise and time to build. Also, these models require rebuilding if the data changes. ML tasks such as regression and classification are performed under a supervised learning environment.
Unsupervised learning takes place without the help of a supervisor. The input data fed to the ML algorithms are unlabeled i.e. for every input no output is known. The algorithm by itself finds out the trends and pattern in the input data and create an association between the different attributes of the input.
This type of learning is useful for finding patterns in data, creating clusters of data, and real-time analysis. Tasks such as Clustering, KNN algorithms, etc., come under unsupervised learning.
Semi-Supervised learning tasks the advantage of both supervised and unsupervised algorithms by predicting the outcomes using both labeled and unlabeled data. Reinforcement learning is a type of feedback mechanism where the machine learns from constant feedback from the environment to achieve its goal.
In this type of learning, the AI agents perform some actions on the data and the environment gives a reward. Reinforcement learning is used by multiplayer games for kids, self-driving cars, etc.
Stay tuned to our upcoming tutorial to know more about Machine Learning And Artificial Neural Network!