4 Machine Learning Approaches that Every Data Scientist Should Know | by Orhan G. Yalçın | Nov, 2020
Artificial Intelligence Essentials
Understanding the Major ML Approaches: Supervised Learning, Unsupervised Learning, Semi-Supervised Learning, Reinforcement Learning
With the constant advancements in artificial intelligence, the field has become too big to specialize in all together. There are countless problems that we can solve with countless methods. Knowledge of an experienced AI researcher specialized in one field may mostly be useless for another field. Understanding the nature of different machine learning problems is very important. Even though the list of machine learning problems is very long and impossible to explain in a single post, we can group these problems into four different learning approaches:
- Supervised Learning;
- Unsupervised Learning;
- Semi-supervised Learning; and
- Reinforcement Learning.
Before we dive into each of these approaches, let’s start with what machine learning is:
The term “Machine Learning” was first coined in 1959 by Arthur Samuel, an IBM scientist and pioneer in computer gaming and artificial intelligence. Machine learning is considered a sub-discipline under the field of artificial intelligence. It aims to automatically improve the performance of the computer algorithms designed for particular tasks using experience. In a machine learning study, the experience is derived from the training data, which may be defined as the sample data collected on previously recorded observations or live feedbacks. Through this experience, machine learning algorithms can learn and build mathematical models to make predictions and decisions.
The learning process starts by feeding training data (e.g., examples, direct experience, basic instructions) into the model. By using these data, models can find valuable patterns in the data very quickly. These patterns are -then- used to make predictions and decisions on relevant events. The learning may continue even after deployment if the developer builds a suitable machine learning system which allows continuous training.
Top machine learning approaches are categorized depending on the nature of their feedback mechanism for learning. Most of the machine learning problems may be addressed by adopting one of these approaches. Yet, we may still encounter complex machine learning solutions that do not fit into one of these approaches.
This categorization is essential because it will help you quickly uncover the nature of a problem you may encounter in the future, analyze your resources, and develop a suitable solution.
Let’s start with the supervised learning approach.
Supervised learning is the machine learning task of learning a function that maps an input to an output based on example input-output pairs. It infers a function from labeled training data consisting of a set of training examples.
The supervised learning approach can be adopted when a dataset contains the records of the response variable values (or labels). Depending on the context, this data with labels is usually referred to as “labeled data” and “training data.”
Example 1: When we try to predict a person’s height using his weight, age, and gender, we need the training data that contains people’s weight, age, gender info along with their real heights. This data allows the machine learning algorithm to discover the relationship between height and the other variables. Then, using this knowledge, the model can predict the height of a given person.
Example 2: We can mark e-mails as ‘spam’ or ‘not-spam’ based on the differentiating features of the previously seen spam and not-spam e-mails, such as the lengths of the e-mails and use of particular keywords in the e-mails. Learning from training data continues until the machine learning model achieves a high level of accuracy on the training data.
There are two main supervised learning problems: (i) Classification Problems and (ii) Regression Problems.
In classification problems, the models learn to classify an observation based on their variable values. During the learning process, the model is exposed to a lot of observations with their labels. For example, after seeing thousands of customers with their shopping habits and gender information, a model may successfully predict the gender of a new customer based on his/her shopping habits. Binary classification is the term used for grouping under two labels, such as male and female. Another binary classification example might be predicting whether the animal in a picture is a ‘cat’ or ‘not cat,’ as shown in Figure 2–4.
On the other hand, multilabel classification is used when there are more than two labels. Identifying and predicting handwritten letters and numbers on an image would be an example of multilabel classification.
In regression problems, the goal is to calculate a value by taking advantage of the relationship between the other variables (i.e., independent variables, explanatory variables, or features) and the target variable (i.e., dependent variable, response variable, or label). The strength of the relationship between our target variable and the other variables is a critical determinant of the prediction value. Predicting how much a customer would spend based on its historical data is a regression problem.
Unsupervised learning is a learning approach used in ML algorithms to draw inferences from datasets, which do not contain labels.
There are two main unsupervised learning problems: (i) Clustering and (ii) Dimensionality Reduction.
Unsupervised learning is mainly used in clustering analysis.
Clustering analysis is a grouping effort in which the members of a group (i.e., a cluster) are more similar to each other than the members of the other clusters.
There are many different clustering methods available. They usually utilize a type of similarity measure based on selected metrics such as Euclidean or probabilistic distance. Bioinformatic sequence analysis, genetic clustering, pattern mining, and object recognition are some of the clustering problems that may be tackled with the unsupervised learning approach.
Another use case of unsupervised learning is dimensionality reduction. Dimensionality is equivalent to the number of features used in a dataset. In some datasets, you may find hundreds of potential features stored in individual columns. In most of these datasets, several of these columns are highly correlated. Therefore, we should either select the best ones, i.e., feature selection, or extract new features combining the existing ones, i.e., feature extraction. This is where unsupervised learning comes into play. Dimensionality reduction methods help us create neater and cleaner models that are free of noise and unnecessary features.
Semi-supervised learning is a machine learning approach that combines the characteristics of supervised learning and unsupervised learning. A semi-supervised learning approach is particularly useful when we have a small amount of labeled data with a large amount of unlabeled data available for training. Supervised learning characteristics help take advantage of the small amount of label data. In contrast, unsupervised learning characteristics are useful to take advantage of a large amount of unlabeled data.
Well, you might think that if there are useful real-life applications for semi-supervised learning. Although supervised learning is a powerful learning approach, labeling data -to be used in supervised learning- is a costly and time-consuming process. On the other hand, a sizeable data volume can also be beneficial even though they are not labeled. So, in real life, semi-supervised learning may shine out as the most suitable and the most fruitful ML approach if done correctly.
In semi-supervised learning, we usually start by clustering the unlabeled data. Then, we use the labeled data to label the clustered unlabeled data. Finally, a significant amount of now-labeled data is used to train machine learning models. Semi-supervised learning models can be very powerful since they can take advantage of a high volume of data.
Semi-supervised learning models are usually a combination of transformed and adjusted versions of the existing machine learning algorithms used in supervised and unsupervised learning. This approach is successfully used in areas like speech analysis, content classification, and protein sequence classification. The similarity of these fields is that they offer abundant unlabeled data and only a small amount of labeled data.
Reinforcement learning is one of the primary approaches to machine learning concerned with finding optimal agent actions that maximize the reward within a particular environment. The agent learns to perfect its actions to gain the highest possible cumulative reward.
There are four main elements in reinforcement learning:
- Agent: The trainable program which exercises the tasks assigned to it
- Environment: The real or virtual universe where the agent completes its tasks.
- Action: A move of the agent which results in a change of status in the environment
- Reward: A negative or positive remuneration based on the action.
Reinforcement learning may be used in both the real world as well as in the virtual world:
Example 1: You may create an evolving ad placement system deciding how many ads to place on a website based on the ad revenue generated in different setups. The ad placement system would be an excellent example of real-world applications.
Example 2: On the other hand, you can train an agent in a video game with reinforcement learning to compete against other players, usually referred to as bots.
Example 3: Finally, virtual and real robots training in terms of their movements are done with the reinforcement learning approach.
Some of the popular reinforcement learning models may be listed as follows:
One of the disadvantages of the popular deep learning frameworks is that they lack comprehensive module support for reinforcement learning, and TensorFlow and PyTorch are no exception. Deep reinforcement learning can only be done with extension libraries built on top of existing deep learning libraries such as Keras-RL, TF.Agents, and Tensorforce or dedicated reinforcement learning libraries such as Open AI Baselines and Stable Baselines.
Now that we covered all four approaches, here is a summary visual to make basic comparison among different ML approaches:
The field of AI is expanding very quickly and becoming a major research field. As the field expands, sub-fields and sub-subfields of AI have started to appear. Although we cannot master the entire field, we can at least be informed about the major learning approach.
The purpose of this post was to make you acquainted with these four machine learning approaches. In the upcoming post, we will cover other AI essentials.
If you liked this post, consider subscribing to the Newsletter! ✉️
Besides my latest content, I also share my Google Colab notebooks, containing full codes for every post I published.
Since you are reading this article, I am sure that we share similar interests and are/will be in similar industries. So let’s connect via Linkedin! Please do not hesitate to send a contact request! Orhan G. Yalçın — Linkedin
Take a look at the guide to my content: