What are the types of Machine Learning?

Jagajith
CodeX
Published in
9 min readAug 28, 2021

As a follow-up to my last about Machine Learning, in this post, I’ll talk about the different types of machine learning algorithms and how they can be used. This will help you get a better understanding of the different machine learning algorithms used today.

Terms frequently used in this post:

  • Labeled data: Data consisting of a series of training examples[(x1, y1), (x2, y2),…, (xn, yn)], where each example is a pair consisting of the sample’s input and output value. Given the “right answer” for each example in the data. Here y1, …, yn is the right answer for a specific example.
  • Unlabeled data: Data consisting of only of input values [(x1), (x2), …, (xn)]. It does not come with the “right answer”.

Types of Machine Learning:

The following are the several types of machine learning:

  • Supervised Learning
  • Unsupervised Learning
  • Recommender Systems
  • Reinforcement Learning

Supervised Learning

The most widely used machine learning approach is supervised learning. It is the most straightforward to grasp and implement. It’s similar to teach a child something.

  • Supervised learning algorithms attempt to model the relationship between the model’s prediction(output) and the input features in order to predict the output values for new data on the relationships learned from previous datasets.
  • We can input a learning algorithm data in the form of example-label pairs one by one, allowing the algorithm to predict the label for each sample and providing feedback on whether it predicted the correct answer or not.
    The algorithm will gradually learn to predict the exact nature of the relationship between samples and labels.
  • The supervised learning algorithm will be able to observe a new, never-before-seen sample and predict a good label for it once it has been fully trained. Because of this, supervised learning is frequently defined as task-oriented. It is highly focused on a single task, providing the algorithm more and more examples until it can accurately perform that task.

Example

Assume you have two balls, one made of leather and the other a regular ball.
You’re curious as to which one will be used to play cricket. The ball’s owner purchases a machine that describes the ball’s features (Size, weight, color, and material). While the color feature is useless for predicting which one is used to play cricket, it is helpful to identify if one is new or old. Without using an algorithm, we can see that the weight and size of the leather ball are specific, indicating that this is the best ball to use for playing. Similarly, our machine learning algorithm will analyze and learn the weights of both balls, allowing it to predict which is leather and which is not.

Supervised Learning can be classified into two types: Regression and Classification.

Regression

Regression techniques can be applied to data that is continuous. It is also called a “line of best fit”, which we have learned in high school by graphing a line that passes approximately through all the points in the graph. It uses features to explain the relationship between the objects. Because the data is continuous, it can best explain whether or not there is a direct relationship. The ideal example is if we want to determine the rate of business growth or the rate of tumor growth in a cancer patient.

Classification

Classification techniques can be applied to data that are discrete(i.e 0 or 1). It distinguishes between two or more items. If you’re trying to figure out if this is an apple or a banana, the answer is either 1 or 0. This is referred to as binary classification because it occurs between two entities.

Classification vs Regression

Supervised Learning Algorithm

  • Nearest Neighbor
  • Naive Bayes
  • Decision Trees
  • Linear Regression
  • Support Vector Machines (SVM)
  • Neural Networks

Here support vector machine is the widely and most used algorithm in supervised learning.

Application of Supervised Learning

  • Advertisement Popularity: Choosing ads that will work well is frequently a supervised learning activity. Many of the advertising you see on the internet are there because a learning algorithm determined that they were popular enough (and clickability). Furthermore, its placement on a certain site or in response to a specific query (if you’re using a search engine) is largely due to a learning algorithm indicating that the ad and location match would be beneficial.
  • Spam Classification: If you use a modern email system, you’ve probably run into a spam filter. A supervised learning system is what that spam filter is. These systems learn how to filter out dangerous emails before they reach their users by being fed email examples and labels (spam/not spam). Many of them also allow users to give new labels to the system, which allows it to learn user preferences.
  • Face Recognition: Do you use Facebook? Most likely, your face has been trained to recognize you using a supervised learning algorithm. A supervised process is having a system that takes a photo, finds faces, and guesses who is in the photo (suggesting a tag). It contains several levels, such as detecting faces and then recognizing them, but it is still supervised.
Spam Detection

Unsupervised Learning

  • The direct opposite of supervised learning is unsupervised learning.
    Here, the learning algorithm is trained with unlabeled data. Our algorithm would be fed a large amount of data and given the tools necessary to recognize the data’s features. It can then learn to group, cluster, and/or organize the data in such a way that a person (or another intelligent algorithm) can understand the newly organized data.
  • Unsupervised learning is a way to recognize and analyze hidden patterns in between the datasets. Unlike supervised learning, no training will be given to the machine. The model is restricted to find the unknown formation in unlabeled data.
  • Here there’s no teacher at all, actually, the learning algorithm might be able to teach you new things after it learns patterns in data, these algorithms a particularly useful in cases where the human expert doesn’t know what to look for in the data.

Example

The best example is identifying a specific type of potato, based on the characteristics provided. Assume you’re given the color and size of a potato but don’t know which one is which, resulting in unlabeled data. We can distinguish them here without applying the algorithm because of their color.
Unsupervised learning is the same way.

Different types of Unsupervised Learning

  1. Clustering
  2. Association

Clustering

It deals with finding a way of structure or pattern in uncategorized data.
Clustering algorithms will iterate and analyze the information over and again until they find a pattern (groups). The clusters that are created can be modified and labeled.

Clustering

Association

Where there is a large database it discovers interesting relationships between variables. For example, people that buy a new home are most likely to buy new furniture.

Unsupervised Learning Algorithm

  • Hierarchical clustering
  • K-means clustering
  • K-NN (k nearest neighbors)
  • Principal Component Analysis
  • Singular Value Decomposition
  • Independent Component Analysis

Application of Unsupervised Learning

  • Buying Habits: Your purchasing habits are almost certainly stored in a database, and that data is being actively bought and sold right now.
    Unsupervised learning algorithms can use these purchasing habits to group clients into similar purchasing segments. This aids organization in marketing to these segmented groups and can even be compared to recommender systems.
  • Grouping User Logs: We can utilize unsupervised learning to group user logs and issues, which is less user-facing but still highly useful. This can assist businesses in identifying major themes in issues that their consumers are experiencing and resolving these issues by upgrading a product or creating a FAQ to address prevalent issues. In either case, it’s something that’s actively done, and if you’ve ever reported a problem or an issue with a product, it’s probable that it was fed into an unsupervised learning algorithm to cluster it with other comparable issues.
Unsupervised Learning

Recommender Systems

You probably have found a video recommendation algorithm if you have ever used YouTube or Netflix. Often these systems are in the unsupervised domain.
We know video stuff, perhaps its length, genre, etc. We are also aware of many users’ watch histories. With users watching similar videos like you and enjoying other videos you still have to watch, a recommendation system can view this connection in the information and prompt you for such a suggestion.

Reinforcement Learning

  • Reinforcement Learning is a branch of Artificial Intelligence that is a form of Machine Learning. When compared to supervised and unsupervised learning, reinforcement learning is quite different. Where we can easily see the relationship between supervised and unsupervised (the presence or absence of labels), the relationship to reinforcement learning is a bit unclear.
  • It enables machines and software agents to automatically select the best action in a particular situation in order to improve their efficiency. For the agent to learn its action, it needs only simple reward feedback, which is known as the reinforcement signal.
  • Assume there is a game in which the player (model) advances two steps if the prediction is true and moves back one step if the prediction is incorrect. It is up to the model to perform properly, and it learns through this process. What factors did it consider when making the decision? The answer to this issue is a “hit-or-miss” approach.

Example

Assume that in an autonomous vehicle, it is necessary to prioritize safety, follow rules, stick to safety, reduce journey time, and reduce pollution.
As a result, because making all of these decisions at the same time is challenging, therefore the agent is given if-else instructions (reinforcement learning algorithm).

Reinforcement Learning

List of Common Algorithms

  • Q-Learning
  • Temporal Difference (TD)
  • Deep Adversarial Networks

Applications of Reinforcement Learning

  • Video Games: Learning to play games is one of the most common applications of reinforcement learning. Take a look at AlphaZero and AlphaGo, two Google reinforcement learning applications that trained to play the game Go. Our Mario example is a well-known one. I’m not aware of any production-ready games that use a reinforcement learning agent as their game AI, but I expect that this will soon be a decent choice for game developers.
  • Industrial Simulation: For many robotic applications (think assembly lines), having our machines learn to execute jobs without having to hard-code their methods is advantageous. This can be a less expensive and safer choice, with a lower risk of failure. We can also employ initiatives to promote our machines to consume less electricity, saving us money. Furthermore, we can begin this process in a simulation to avoid wasting money if our machine malfunctions.
  • Resource Management: For exploring complex environments, reinforcement learning is beneficial. It can deal with the necessity to strike a balance between several criteria. Take Google’s data centers, for example. They employed reinforcement learning to strike a balance between the necessity to meet our electricity requirements while also reducing expenses. What impact does this have on us and the general public? We’ll save money on data storage as well, and we’ll have less of an influence on the environment we all share.

Final Notes

There is possible to use different criteria to classify types of machine learning algorithms but I think using the learning task is great to visualize the big picture of ML and I believe according to your problem and the data you have in hand you can easily decide if you will use Supervised, unsupervised or reinforcement learning. In the upcoming posts, I’ll deep dive into each type of machine learning algorithm.

If you like this post, then check out my other posts in this series about

1. What is Machine Learning?

2. Uni-Variate Linear Regression

3. Multi-Variate Linear Regression

4. Logistic Regression

5. What are Neural Networks?

6. Digit Classifier using Neural Networks

7. Image Compressing with K-means Clustering

8. Dimensionality Reduction on Face using PCA

9. Detect Failing Servers on a Network using Anomaly Detection

Last Thing

If you enjoyed my article, a clap 👏 and a follow would be ridiculous and it is helpful for medium to promote this article so that others may read it. I am Jagajith and I will catch you in the next one.

--

--