17 January, 2022 Applying Machine Learning to predict the price of a commodity Applying Google Artificial Intelligence, we developed a project to predict the price of a raw material with Machine Learning. In the age of data, predicting the future is not entirely impossible. We are not talking about guessing the lottery number or foreseeing unexpected events - such as the emergence of a global pandemic. We are referring to all those events that tend to repeat themselves periodically. Facts that, by analyzing a history of information, we can detect what patterns and trends they follow. In this way, we can even foresee when and how they will happen again. Until recently, it was not possible to anticipate these events for several reasons: A multitude of factors, external and internal, are involved, and there were no tools to assess them all with a broad view. It was not possible to have the large volume of data needed. There were no tools to analyze all that volume, establish patterns and outline trends. But globalization and the hyper-connectedness that the internet has brought us, together with the development of Artificial Intelligence, have solved these problems. On the one hand, thanks to connectivity, it is possible to access reliable sources of information. On the other hand, the advance of machine learning makes it possible to create models that draw on this volume of data, process it and anticipate events. In order to explain deeply how predictive models work, we are going to take as a reference a project that we developed, as a specialist partner in Machine Learning of Google Cloud, for an international company. This company, dedicated to the transformation of a high-value raw material, managed to know with a high degree of accuracy how the price of this material would behave 180 days in advance. Price forecasting with ML Monitoring raw material price changes is a critical activity for the processing industry. Indeed, the competitiveness and optimization of processing companies depend to a large extent on: Comprehensive monitoring of market fluctuations Ability to anticipate price increases These price fluctuations and price changes also depend on many different factors. They range from socio-economic to geopolitical issues and they involve not only external elements but also those related to the company itself. For all these reasons, carrying out this task becomes a rather complex task. However, as we mentioned, it is now possible thanks to Artificial Intelligence. And not only that: it is also possible to do it in an automated way, for instance, with the Google Cloud Platform technology of which we are experts. In this global demand scenario, highly determined by delivery times and other socio-economic factors, our client needed to predict price variations in the market 2-3 months in advance. This matter would ensure that they could meet their demand and get the best price. For eºmergya, the challenge was not only to find a solution that would automate price prediction but to do it in advance and accurately. Optimize decision making In order to generate the automation sought by our client, we opted for a solution based on Google's Vertex AI technology. We use several sources of information to feed our Machine Learning model: Historical commercial data from the purchasing department Historical data on raw materials in the market Stock market prices of the producers and processors of these raw materials. We then developed a predictive model to estimate the price of our client's raw material in the market. With ML techniques, we were also able to analyze the quality of the available data, their correlations and patterns. The next step was to choose the correct algorithms and a specific dataset. These were used to train a minimum viable model powered by Vertex AI, which validated the first results. Once the model was proved, the solution was fully implemented. In terms of results, our model could predict the value of raw materials 2, 3 and 6 months in advance. This prediction had a different margin of error, in other words, the error was bigger the longer the forecast period. In fact, in the 2- and 3-month predictions, the predicted price had a high rate of coincidence with the price that finally prevailed in the market. Therefore, thanks to these predictions, the decision-making procedure was optimized.