Writen by Rafael Kehl, Data Engineering, in 11/08/2021

8 minutes of reading

Machine Learning: the technology that is driving innovation!

Learn the basic concepts of machine learning, the field that brought agility and quality to technologies we use everyday.


If any app you use do any interpretation, recognition or ranking of something, you can bet it uses machine learning in some part of its process. A good example that you certainly used already is Google, that has a complex algorithm that will interpret your search and bring only the most relevant results for you. For those that use Apple gadgets, Face ID uses a group of sensors in the front of the device to create a 3D map of your face and validate your identity using a machine learning algorithm. All of that happens in a split second with high precision that is only possible to be achieved through machine learning!

Two billion results in a bit more than a half second. Not bad, right?


But after all, what is machine learning?

There are many ways to define machine learning, but I like the one that coined this term, written by Arthur Samuel in 1959:

“Field of study that gives computers the ability to learn without being explicitly programmed”

Although it seems a little obvious, this definition makes two things very clear: machine learning is a field of study, therefore it is always evolving, and computers are not explicitly programmed to solve that given task, which means these algorithms are more general and can help us solve problems similar to those they were designed for.

A good example to get a better understanding of it all is the algorithm that Arthur Samuel himself built to play Checkers. He believed that teaching computers to play games would help us build strategies to solve bigger and more general problems, and so he chose the Checkers game as a starting point. Through a function that would reward each movement on the board, the algorithm would calculate what movements maximized its score and then store all results to further increase its accuracy and evaluation capacity. Although initially the algorithm was not very good at the game, Arthur modified so that it improves the scoring function after playing, thus learning from the result of each game. In time, the algorithm was able to even beat Arthur himself!

Have you ever played Checkers?


In the end, Arthur was right, in teaching the computer to play Checkers he developed a method that evolved, along with other methods, to what we know today as reinforcement learning algorithms, that are used to solve a variety of planning and optimization problems, such as budget or cost planning, delivery routes and risk minimization, all while still being good at gaming!

That was just the beginning of what today is a robust set of tools capable of doing a little of everythin. To better organize these algorithms they are generally separated in three big categories: reinforcement learning, supervised learning and unsupervised learning. Each category is good in solving a kind of problem and, therefore, it is important to know all of them to be able to apply machine learning.


Supervised learning

A supervised learning algorithm is trained with a dataset as input and the desired output for each member of the dataset. These algorithms aim to create a mathematical model that maps each new entry to an approximate result based on the training it received.

The most common supervised learning algorithms are regression and classification. Regression algorithms seek to find a relationship between two or more variables using a mathematical function, and are usually trained with historical data. The simplest form of regression is linear regression, which tries to fit a straight line to the dataset as best as possible. An example of regression would be an algorithm that receives as input the size, number of bedrooms and number bathrooms of a house and outputs an approximate sale value for it.

This is an example of a linear regression algorithm being trained to fit a dataset.


Classification algorithms, as the name implies, seek to classify data according to the training it received. Unlike regression, the algorithm looks for a mathematical function that best separates the different classes it received as input. Again, the simplest classifier is the linear classifier, which separates classes using straight lines. An example of classifier would be an algorithm that was trained with cat pictures and, upon receiving a new picture, it would say wether or not it is of a cat.

A linear classifier being trained to separate two classes.


Unsupervised learning

A unsupervised learning algorithm is trained only with the dataset, without the desired outputs, and aims to identify features or structures in that set. These algorithms are, in general, used to group similar data together, in a process we call clustering, to facilitate data analysis or allow a different treatment for each cluster. The simplest usupervised learning algorithm is called k-means, and clusters data by proximity.

A k-means algorith with k=5 being trained. The solid circles are the input points.


It receives as input the dataset and the initial position of k points. Each point in our dataset is then grouped with the nearest of the k points. Finally, the mean, or central, position of each cluster is calculated and the point that defines that cluster is moved to that position. The clusters are then recalculated and the process is repeated until there’s no more changes, when we say the method has converged.

These algorithms are much more complex than the supervised, and have important applications for when the data volume is too large, where it would be too costly or even impossible to provide the desired output for each member of the training dataset. An example of unsupervised learning algorithm application would be for marketing campaigns, where the algorithm groups and characterizes users so that they receive more relevant ads.


Reinforcement learning

As we previously saw, reinforcement learning algorithms are used to solve planning and optimization problems, and they are good at that because they were developed to maximize reward over time when interaction with the environment they’re in. In the case of Arthur Samuel’s Checkers playing algorithm, the reward was given through the scoring function created by Arthur and the environment is the game of Checkers.

These methods aim to train the computer to take actions the same way an intelligent agent would when put in the same environment, and that is why they are so general and so useful. Basically, in any process in which there is some decision making with an associated reward, this type of algorithm will have some application, especially in game theory, statistics and control theory. The most famous examples of these applications often involve complicated games where the computer beat the best human players in the world, such as chess, go, and Dota 2. In this last example, the algorithm not only beat the world champion team, but the bots had to work as a team to achieve this feat, as Bill Gates noted on his Twitter!

Bill Gates comments that OpenAI’s teamwork was a huge milestone in advancing AI.



Well, now that we know what machine learning is and what we use it for, it’s time to put this knowledge into practice! But that’s for our next blog post, in the meantime, you can take a look at the free Machine Learning course taught by Andrew Ng, from where I got inspiration for part of this post.

Stay tuned at our blog, soon I’ll be back so we can implement our first machine learning algorithm. See you!

Share it: