Machine Learning Series | part 3

VedantGolegaonkar
7 min readApr 3, 2022

Types of Machine Learning

Basically ML is divided into four types:
1. Supervised
2. Unsupervised
3. Semi-Supervised
4. Reinforcement Learning
This is the famous categorization seen.

Let us understand everything in very detail. We will start with supervised ML. So what is Supervised ML?

Types of ML

See ML is all about learning from data. The data has input as well as output. If there a data where you have to find the relation between the input and the output then this type of ML is called as supervised ML. let us understand this with an example. I have a data of 10000 students that have two columns(height, weight) and an output column as the student is a boy or a girl. See the below image for for a sample of 5 students. From here we it is clearly visible that height and weight are the input column and the last column which identifies the gender, is an output column. Input can be said as independent variable and output as dependent variable. We train this data, So when a new input is given the algorithm will correctly identify.

let me summarize this. If you have a data where you have to find a mathematical relation between the input and the output column and make a prediction on the new input then this type of ML is called as Supervised ML.

Supervised ML has two parts : 1. Regression 2. Classification.

Before Understanding these types we should the different types of data. Data is divided into two types: Numerical and Categorical. Numerical data is like age, weight, height, mobile number, etc. and categorical data is like gender, nationality, etc. Now that we know the types of data lets understand the parts of supervised learning.

What is Regression?
lets say you are working on a supervised ML problem that means you have input and output columns and the output column is a numerical column then this type of Supervised ML is called as Regression.

What is classification?
If you have understood Regression properly then understanding classification is very simple. Classification is a type of Supervised ML where the output column is categorical.

It’s very easy guys to understand a supervised ML problem. You just have to ask yourself that does the data has an input and an output column if yes, then if the output column is numerical then it’s a regression problem and if it’s a categorical column then it’s a classification problem.

Now that you know Supervised ML, let us understand Unsupervised ML.

Unsupervised Machine Learning:

Unsupervised ML is quite opposite as that of Supervised ML. Unlike as supervised ML, here we have only input column. So, here we cannot make prediction since we do not have output column. Now you might say what is the use of this data then. Here we do perform these 4 types of algorithm.
1. Clustering
2. Dimensionality Reduction
3. Anomaly Detection
4. Association Rule based Learning
Now what is Clustering?
Clustering is simply grouping common things together. See this example below in the fig. the data is clustered or grouped together. This type of ML can be used in the banking sector where user are grouped together on some common factor.

What is dimensionality Reduction?
Sometimes what happens is that while doing a supervised ML problem, we have huge input columns. With these input columns the algorithm takes a lot of time to perform the operations. Let’s assume you are working on a projects that helps to predict the price of the houses in New York. You have two columns (No. of Rooms, No. of washrooms) and there is no need of these two columns. Dimensionality reduction is actually reducing the dimensions of the data. This is also called as feature extraction. Dimension means column. The algorithm will automatically combine these two columns and make a new column called as sq. ft. area which is the multiplication of these two columns.

This is also applicable for visualization technique. If you have a dataset with lot of input columns and you have to visualize the the dataset, this is possible with dimensionality reduction technique. There is famous visualization dataset called as “Amnist”. The data set has a image of size 28 x 28 which has a dimension of 784.
This technique is a very powerful technique. You can go and visualize the dataset here.

What is Anomaly Detection?
The name itself says that there is something going wrong and we have to detect the flaw. There are many examples like manufacturing defect, credit card processing has some flaw. You just have to detect the outliers and discard them. See the example below.

These are Some points plotted on the graph. You can see two stars, one with green and one with red. If I have to classify the red star then that will get classify with the black stars. But if i want to classify the green star then the algorithm will say “he is not able to classify. The star is a outlier/ anomaly”. In this way outlier / anomalies are detected. This is most often used in Unsupervised ML.

Association Rule Based Learning?
Let me start this with am example. Let’s say you are the owner of a big shopping complex and you are confused about how should you arrange these products so that customers don’t have to look around for a very long time for the similar type of products. Now you asked me to help you. I already have my own complex. I will ask you to generate the bills of all the customers from the last 6 months, scan those bills and find a pattern where you will see that what products do customer buy with what other product. Let’s say, the top product customer buy is milk (80% of the times) and the second product is eggs(70% of the times). Now you will associate these two products in one section. Similarly you will also associate other products.

The similar incident happened in Walmart. One customer suggested to keep Beer with Baby Diaper. After the study it was found out that out of all the customers who buy baby diapers 80% of them buy a beer. After this incident beer and diaper started to be kept into one section and the sale for Walmart also increased. You can read the story here.

Semi-Supervised Machine Learning:

Semi-Supervised ML is the combination of both Supervised and Unsupervised ML. To create a ML model you will should have an input and an output column. You can easily scrap data from the web for the input column. But for the output column you will have to label those. Suppose you have the Input as a dog and a cat. And the output label is supposed to be given by a human right. This process used to take a lot of human effort. So scientists thought what if we could label only for one the rest of the work is done manually.
Now here semi-supervised ML was introduced. For example:- you are on a holiday to Manali with your friends and family and you clicked a lot of photos. When you arrived home you see a google photos notification saying you to identify the person in the photo. Suppose the person is your father. And in the other photo the person is your mother. Google photos will automatically select the same faces and group them all in one. This is how Semi-Supervised ML works.

Reinforcement Learning:

Let’s recall what is supervised and unsupervised ml. Supervised ml has both, input and output column. Unsupervised has only input column. But in Reinforcement Learning no data is given to the algorithm. In reinforcement learning, the model learns everything from scratch just like human being. It makes mistakes and learns. The best example what I can give you is that of Self Driven Cars.

Let’s see this example. Remember in Reinforcement learning the model is called as agent. In the image see the fist case the agent is trying to observe what is goin on in the surrounding. You have to write a policy in the agent rule book. Suppose you write that the agent has to go near the fire. The agent will go to the fire as told. And you have also told that fire will give you negative reward then the agent will sense the alert and will update its policy saying that fire is a danger. This way the reinforcement learning happens.

I hope I was able to explain properly the types of machine learning. In the next blog we will try learn about batch and online learning.

--

--

VedantGolegaonkar

Free Lancer | Electronics Engineer | ML - DL - AI | Analyst | Web Developer