In our previous article (here), we discussed the classification of the Machine Learning models on five different bases. Based on the nature of input data that we provide to the machine learning algorithms, machine learning can be classified into 4 major categories.
Let’s start without any further delay.
Supervised Learning is a category in which we feed labeled data as input to the machine learning model.
The input and output values are already known, and the machine learning algorithm learns the mapping function. Mathematically, for Y as the Output and X as the input, machine learning algorithms try to find the best mapping function f such that Y = f(X).
If you observe closely, learning happens like some supervisor is supervising the process of the learning. We already know the answers; hence algorithms try to map the function so that the predicted answers must be close to the actual answers. Let’s say the machine has learned a mapping function f predicting the values Y’ for every X. Once the difference between predicted (Y’) and actual (Y) goes below a certain threshold, and it means model performance is not improving further and hence learning stops.
2. Regression:- Taking the example of the below image, there is the experience (in years) on the X-axis. For every experience, there is one salary (in per month Rupees) on the Y-axis. Green dots are the coordinates (X, Y) in the form of Input and Output data. The regression problem tries to find the continuous mapping function from input to output variables.
In the below image, if the order of the mapping function is fixed to 1, which is a linear function, the model will learn the black line shown in the image.
Unsupervised learning is a category of machine learning in which we only have the input data to feed to the model but no corresponding output data.
Here, we know the value of input data, but the output and the mapping function both are unknown. In such scenarios, machine learning algorithms find the function that finds similarity among different input data instances and groups them based on the similarity index, which is the output of unsupervised learning.
In such learning, there is no supervision as there is no existence of output data. Hence they are called Unsupervised learning. Algorithms try to find the similarity between different instances of input data by themselves using a defined similarity index.
Unsupervised Learning can further be categorized as :
2. Dimensionality Reduction:- When the attributes of the data samples have more than three dimensions, there is no way to visualize the relationship among the attributes as we can not plot variables in more than 3 Dimensions. But without analyzing the input data, we can never be sure about the Machine Learning model's performance. To solve this purpose, there are dimensionality reduction techniques using which we bring down the total number of dimensions and analyze the data.
3. Association:- Taking the example of the below image, such learning is more about discovering rules that describe a large portion of the data. Customers who bought a banana also bought carrots, or Customers who bought a new house also bought new furniture.
Semi-supervised learning is a category of machine learning in which we have input data, and only some of those input data are labeled as the output.
Semi-supervised learning is partially supervised and partially unsupervised.
Let’s take one example from the below image to make it clear, suppose there is a bucket consisting of three fruits, apple, banana, and orange. Someone captured the image of all three but labeled only orange and banana images.
Nowadays, it has become a trend to capture a tremendous amount of data. Many big companies have already collected millions of Terrabytes of data and are still collecting. But labeling the collected data requires workforce and resources, and hence it's too expensive. And this is the main reason that many real-life databases fall in this category.
In such type of learning, one can use either.
For example, suppose there is a large chunk of data in the image above, and a small amount of labeled dataset is present. We can train the model using that small amount of labeled data and then predict on the unlabelled dataset. Prediction on an unlabelled dataset will attach the label with every data sample with little accuracy, termed as a Pseudo-labeled dataset. Now a new model can be trained with the mixture of the true-labeled dataset and pseudo-labeled dataset.
Here, ML algorithms act as agents in the environment where these agents choose the possible options of actions. The agent selects the best action from all the options present at that environmental state, and based on that selection, receives reward/risks. The algorithms keep an eye on maximizing the reward and reduce the risk, and eventually learns.
If we look at the history of machine learning, we will find that RL is quite old and in the industry for a longer period of time. But because of the requirement of awareness of the complete environment, it is usually used with simulated environments. Some of the most common use-cases where it is being used in the industry are,
In this article, we described machine learning classification based on the “Nature of input data.” We came across the definition of Supervised, Unsupervised, Semi-Supervised, and Reinforcement Learning and talked about some industry use-case or real-life use-case of these categories. We also listed some famous algorithms associated with each category. We hope you have enjoyed the article.
Get well-designed application and interview centirc content on ds-algorithms, machine learning, system design and oops. Content will be delivered weekly.