Introduction to the types of Machine Learning Algorithms
By: M Project
Tags: Supervised Learning, Machine Learning, Unsupervised Learning, Introduction

Machine Learning is a subfield of Artificial Intelligence. The main idea behind machine learning is to make the machines to learn by itself from data and use the learnt knowledge to predict and determine an unknown state. As you can see from the diagram below, machine learning is a combination of computer science and mathematics and statistics modeling.

Basically, mathematics and statistics models are coded in programming languages to be used on large datasets. Machine learning models can be divided into three categories: Supervised, Unsupervised and Reinforcement learning.

1. Supervised algorithms

As the name suggests, the supervised algorithms require a field of state that helps the algorithms to supervise the results. In essence, each set of inputs corresponds to an output. An output is a pre-known state which allows the algorithms to learn from the input data and map the learnt knowledge to new data. There are two types of supervised algorithms: Classification and Regression.

To simply put, Classification is a technique that determines the categories of given input data. For example, the pictures of cats and dogs are assigned categories “cat” and “dog” which we refer as labels in machine learning.

Classification example

Each input data, in this case pictures of dogs and cats, is associated to a label and a machine learning classification algorithm learns the features from the pictures and correlates them to the labels. The classification models handle linear and non-linear problems. For example, Logistic regression is a linear model which determines the probability of an event’s occurrence. There are many non-linear models such as Decision tree, Random Forest, XGBoost, SVM, KNN, naive Bayes, Discriminant Analysis and Deep learning models such as CNN, RNN and LSTM and so on. Classification models are used in image classification, fraud detection, customer retention, and diagnostic analysis.

Regression on the other hand determines continuous numeric output variable based on the input data. For example, predicting total bill paid for dining is a regression problem because total bill is measured by monetary unit which is expressed by continuous number.

Regression Example

Regression problems vary in scale and scope. The most common regression model is Linear regression. Although Linear Regression can be used to solve many problems, it’s restricted to the principles of normality. Due to its limitations, many extensions of Linear regression were developed such as Ridge, Lasso and ElasticNet Regression models. Also, Time series models are type of regression model because it deals with continuous target variable that is indexed in time order. In addition, the most classification models have versions that can handle continuous target variable such as Random Forest Regressor, XGB Regressor, SVM Regressor and so on. Regression models are used to predict weather, forecast markets which is not limited to financial market, estimate population growth and life expectancy and many more.

The main advantage of supervised models is measurability. The performance of classification and regression models can be measured by comparing prediction result to the actual value using certain metrics. But this type of algorithms require labeled data. In reality, labeling data, for example, to name the entities such as human, dog, bird in an image is a time-consuming task. Therefore, we need to be able to analyze unlabeled data.

2. Unsupervised algorithms

By now, you can tell that unsupervised algorithms don’t have target variable or labels to map the input data. Unsupervised algorithms were developed to explore hidden and implicit patterns, and extrapolation of new features. There are two main types of unsupervised algorithms: to cluster the input data and to reduce the number of features.

Clustering is a method which explores similar patterns among the data points and groups them using the similarity measure. Clustering methods are commonly used in customer segmentation, targeted marketing and recommendation systems. For example, Wayfair is a company that sells furnitures online. Based on their customers’ online ads response data, we identified 6 groups of people with different behaviors. Then we can define those groups such as majority of the people who responded to online ads were roamers who didn’t make any purchase, and spent few seconds on the website. This suggested this group also includes people who clicked the ads accidentally.

Segmentation example (https://mumbrella.com.au/ai-will-mean-the-end-of-customer-segmentation-as-we-know-it-510582)

Most clustering algorithms such as KMeans, DBSCAN, and Hierarchical Clustering are based on similarity or distance measures such as euclidean distance, cosine similarity and Pearson’s correlation. Many different similarity metrics can be applied to the clustering methods depending on the input data type. For example, if the data is a document/ text data, then Manhattan distance and cosine similarity are appropriate. There are more complex clustering algorithms that are based on neural network such as Kohonen’s Self-organizing map (SOM) and its extensions, the learning vector quantization (LVQ), the neural gas, and the ART model.

The main challenge of clustering methods is to determine the number of clusters. Ideally, we need to identify clusters that are distinctly different from each other but in reality, it’s a difficult to know how many groups that people are divided into . In addition, measuring the similarity/ dissimilarity of the clusters can be challenging depending on the method and the application.

Dimensionality reduction is an another way that the unsupervised models are used. Nowadays, lots of data are being generated everyday. Not only the data size, but also the number of variables and attributes is increasing dramatically everyday. It’s true that the more data we have the better. But that is not always the case. Too many variables cause several problems such as increasing difficulty of determining the key variables, complexity of the modeling and calculation time. Large number of variables cause what we call “curse of dimensionality”. Therefore, there are some unsupervised algorithms that aim to solve this problem. Unsupervised learning methods such as Principle component analysis (PCA), T-SNE and UMAP are designed to extract fewer number of new features from large number of features. These algorithms make sure that the new features represent the old ones. By using these algorithms, we can increase efficiency of our models.

Sometimes unsupervised algorithms are combined with supervised algorithms to generate self-learning capability. This type of models are called semi-supervised models which we will cover in later articles.

3. Reinforcement learning

The main purpose of reinforcement learning is to train the machine learning models to make sequence of decisions. Complex machine learning models which we call “agents” make decisions in an uncertain environment. Basically, the decisions are reflected in their actions and depending on the outcome, rewards or penalties are given, so that the agents can adjust their next action. The goal of reinforcement learning models is to maximize the total reward or minimize the total penalty. The main characteristics of this method is that there is no supervisor.

Reinforcement learning

For example, let’s think about 4-year old toddler who wants to sit on a sofa. In order to accomplish that, he will try not to hurt himself in the process. By trial and error, eventually he will find his way up. Logic behind reinforcement learning is same as the toddler’s analogy.

Reinforcement learning applications have been increasing in the recent years. Examples include autonomous cars, industrial robotics such as automated hands, and development of medicines. It’s also used in marketing such as ads optimization and A/B testing. The gaming industry is extensively using reinforcement learning to enhance game play experience.

This article may seem general, but Artificial Intelligence is a broad sector to summarize in only one article. We will take a closer look at each method in the following articles. Thank you for reading.

Sources: