# Types of machine learning algorithms

27 May 2018As we saw in the first post, machine learning consists of a set of algorithms that learn and solve problems thanks to experience. There are several types of problems that are addressed with machine learning techniques, among them are *classification* problems (where we want to predict a class), *regression* problems, *time series*, etc. In this post I discuss the different types of learning that machine learning algorithms use.

Machine learning algorithms can learn in 4 different ways: through **supervised learning**, with **unsupervised learning**, with **semi-supervised learning** or with **reinforcement learning**.

The first 3 types of algorithms differ in the a priori knowledge that each one has. The two extremes are supervised, where there is a priori knowledge of the data, and the unsupervised, characterized by the absence of a priori knowledge.

## Supervised learning

These methods are the easiest to perform. They are based on a priori knowledge. The objective is, using some training data, to deduce a function that makes the best possible mapping between inputs and output. The training data consist of tuples , where is the variables that predict a certain output .

The variable to predict can be a quantitative variable (as in the case of regression problems) or a qualitative variable (as in the case of classification problems).

The objective of supervised learning is to obtain an unknown function given some tuples .

An estimate of the function is obtained, as that function that minimizes the empirical risk on the training set.

The function of empirical risk has the following formula:

being a cost function, a set of parameters and the data that the variable predicts.

You can approximate the function f with such that:

An example of a cost function in a regression problem is:

## Unsupervised learning

Unlike in supervised learning, in this case there is no a priori knowledge. Here you do not have tuples , you simply have .

The goal of unsupervised learning is to model the structure or distribution of the data to learn more about them. It serves both to understand and to summarize a set of data.

It is called unsupervised because, unlike the supervised one, it tends to be more subjective since it does not have correct answers. Algorithms serve to discover and present interesting structures in the data.

In general terms, they can be grouped into clustering algorithms and association algorithms.

## Semi-supervised learning

Semisupervised learning is halfway between supervised and unsupervised learning.

Now what we have is both tagged data and untagged data, that is, in addition to having tuples , we have data only of of which we do not know your answer .

The challenge is to combine tagged and untagged data to build a supervised model model that is better because:

- The amount of tagged data can be increased, which generally improves the results of the models.
- There is a high cost of tagging data without labels.
- It assumes that the tagged and untagged data come from the same distribution. On the other hand, there may be a bias in the choice of unlabelled data.

Among the semi-supervised learning methods are:

- Selft-training
- Co-training
- Assemble
- Re-Weighting

## Reinforcement learning

In cases of supervised learning, tuples are available. However, the case of reinforcement learning we have unsupervised problems that only receive re-feeds or reinforcements (for example, win or lose).

The supervised information is replaced by information of the action/reaction type.

The goal in reinforcement learning is to learn to map action situations to maximize a certain reward function.

In these problems an agent learns by trial and error in a dynamic and uncertain environment.

In each interaction, the agent receives as input a current status indicator and selects a certain action that maximizes a reinforcement or reward function in the long term.

This sequential decision process can be characterized as a Markov process.