Messi and Machine Learning

Author: Claire Walsh

Machine learning is a current ‘hot topic’, which has been headlining in technology discussion in recent years. What really is machine learning? Many people do not understand this fundamental topic.

There’s a famous quote from Tom M. Mitchell: “A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P, if its performance at task in T, as measured by P, improves with experience E”. Even reading this is difficult to comprehend and understand; without really breaking it down and possibly drawing it out. I often think about real life analogies which come to mind when approaching difficult definitions like this. As a massive sports fan, famous athletes immediately spring to mind. Think about Leonel Messi as a “machine learning algorithm”. Let him be simple linear regression, classification, a simple neural network, or a complex deep neural network with 200 hidden layers.

Looking again at the quote above: Messi learns from training (the Experience, E) how to perform at his absolute best (Task, T) and is measured by the amount of goals and assists in which he records (Performance, P). His performance and therefore goals/assists will improve with training. Maybe it’s just me, but that makes it a lot more imaginable than trying to visualise a computer program performing tasks and improving with consistent training/experience.

A fundamental aspect of machine learning is the training and testing phases. Back to sport, any sport, this directly lines up with training for an event, and performing. Whether it’s the champions league final, or just a local road race for a casual runner, this would be the same as the testing phase for a machine learning algorithm. The testing phase basically asks the question “How well did you train for this? did you learn relationships between input features in order to be able to predict outcomes?”

Did you overfit? Those of you who have experience with machine learning will understand this term. Basically, it means that you focus too heavily on a certain dataset and it’s not possible to adapt to new data. Relating this back to sport – did you just train in the sun? this means that you will probably be at your best performance in the sun. What happens if it’s raining on the day of your race? You will struggle to adapt. Similarly, a machine learning algorithm will struggle to adapt if it doesn’t have a wide variety of data which it can learn from. An important aspect of machine learning is generalisation: which refers to being able to “Generalise” to new situations and have enough variance in the training to be able to adapt when new things happen. But be careful! You don’t want to underfit: which means you have not managed to capture the underlying trend of the data.

Take linear regression: and consider Messi deciding how much weight to put on a pass. In training, Messi will have passed the ball thousands of times, in all different weather conditions, in different areas of the pitch, against different qualities of players. After taking all of these “features” into consideration, he will decide to place weight X on the ball, as judged appropriate to a specific situation in the game. He will have a certain level of confidence in his getting this right, based on his training methods. Although of course this is not the same as a linear regression algorithm learning from input data and predicting output based on its “learning phase”, I can’t help but compare the two in an extremely simple manner.

Take classification: and then picture a free kick in the world cup final. Messi has two choices, he will either cross the ball or take a shot. He will consider every historical situation like this, he will also look at the weather conditions especially the wind, the ability of the keeper, and the size of the wall. He will decide based on this analysis which has the highest probability of success and then decide to do one or the other.