Lee Sedol was just 12 years old when he became one of the youngest professional Go players in history. When he walked through the doors of the Four Seasons Hotel in Seoul on March 9, 2016, he was 33 years old and was an 18-time world champion. Five intense games against a tough opponent awaited him. To the general astonishment he lost 4-1. That day would go down in history as the day the Go world champion lost against AlphaGo, a computer program belonging to the DeepMind division of Google. Lee Sedol would also go down in history as the only human to ever win a game at AlphaGo (although he would later admit that it was due to a bug in his program).
Much of AlphaGo's black magic comes from the use of Machine Learning and Artificial Intelligence techniques and systems. Systems Machine learning(ML) o automatic learning, are behind many of the high-tech products that surround us, web search engines, speech recognition on our devices, recommend movies and series on our favorite streaming platforms, and even detect spam from our post.
But what advantages does the use of ML offer compared to other traditional programming techniques?
Using the email anti-spam use case above, thanks to the approach based on Machine Learning techniques the system will focus on learning to get ahead of the problem, instead of always going in tow. It is what is called "to train" our model, which will study which words or phrases appear more frequently in emails labeled as spam, compared to "good" emails. The objective is to independently classify the new emails that reach us.
Furthermore, suppose our intelligent Spammer Compulsive detects that we block those emails where the word "free" appears and begins to replace it with the word "free", and so on, changing the rules. A traditional approach forces us to have a team of programmers constantly changing our detection patterns and re-delivering. However, with the systems-based approach of Machine Learning, it automatically detects these unusually frequent patterns in emails marked as spam, learns and goes on to mark them without human intervention.
Will these ML systems replace the work of programmers?
Interesting field, we will talk about it in future installments.
Another field where Machine Learning systems shine spectacularly is in the handwriting (or speech) recognition. We could write a program that would detect certain strokes or even the entire alphabet, but this would not scale to the thousands of combinations written by millions of people in the world. The best way is to train an ML model, providing her with hundreds of examples of different typefaces and handwritten patterns.
As we can see, Machine Learning systems are being applied en masse in processes with a large number of rules, in business solutions where it is necessary to adapt instantly to new data, or to treat unstructured information (sounds, images). They have come to stay.
Classifying Machine Learning systems
There are very different ways to classify Machine Learning systems. The most accepted are the following:
- If they are trained with human supervisionThey are classified as: supervised, unsupervised, semi-supervised and reinforcement learning.
- If they can learn incrementally "on the fly", are classified into online learning and batch learning.
- According to the way of learning we have the instance-based learning, where systems learn examples "by heart" and then generalize to new examples using measures of similarity, vs model-based learning, where the system creates a model from training examples that you will use later to make predictions.
These typologies are not exclusive. Our anti-spam system is a case of [supervised] [on-line] [model-based] learning, if we train it with a neural network.
Let's look at a case of ML system with human supervision: Bank loans! One morning we went (well ... we connected) to our "friendly bank" to ask for a loan to set up our dream chestnut stand. After filling in several forms with all kinds of data, the branch manager summons us for the following week, where he will inform us if he grants us this loan.
How does the bank know if we will repay the loan? The bank has information on hundreds of thousands of other operations similar to ours and knows whether the client repaid the loan or not (that is, has tagged data to feed supervised learning). With the data we have provided and its classification models, the bank can predict with a certain level of probability to what extent we will be able to repay the loan. It is up to the branch manager whether to blindly trust what these models predict… Or is it the other way around? ?
In unsupervised learning we do not have labeled data, so the system must learn without a teacher. Unsupervised algorithms are invincible at detecting relationships or clusters between data, something that a person would find it very difficult to detect. Thus, the models behind the online sales companies detect that people who buy a certain product X also usually buy product Z, so they usually make suggestions to us ("You may be interested ...", "Other customers too bought… ”, etc.) during the purchase process. Does this sound familiar to you?
These types of unsupervised algorithms are also used for anomaly detection (Basic in the prevention of bank fraud or in the detection of manufacturing defects). The system is trained with normal examples, so it is able to determine whether or not a new instance (banking transaction, manufactured product) is an anomaly.
Detecting anomalies is the first step on a path that leads us to be able to predict behaviors. Early detection is an exciting field that we will explore in a future article.
Image classification systems are examples of semi-supervised learning- They are able to detect people and will probably determine that person X appears in the next group of images. You just have to help him by indicating who that person is so that the next time he knows how to label them correctly. This is how they learn Adobe Lightroom (spectacular) or Google Photos.
Finally, the reinforcement learning It is a very different type from the previous ones and the strongest trend today. The system obtains rewards or penalties based on its actions, defining and fine-tuning these calculations is the challenge of the system designers. Must be able to learn from the result of actions, choosing what would be the best strategy (called politics) to obtain the greatest reward over time. AlphaGo is a remarkable example of reinforcement learning. He learned his winning politics by studying millions of games and during his fight with the world champion he applied the policies he had learned. Safe bet!
If you want to go deeper, in subsequent deliveries we will explain some of the most suitable languages and your why or what tool combinations that we have at our disposal as Python, Jupyter Notebook, Scikit-Learn, Tensor-Flow, Keras, etc.. All this with practical examples, is our DNA.
Welcome to the world of Machine Learning!
By the way, just 3 years after his defeat by AlphaGo, Lee Sedol withdrew from official competitions. If you have the opportunity, do not stop watching the documentary AlphaGo - The movie, which narrates the passionate chronicle of the combat between both “minds”.