## 2 Literature Review  
Prediction in logistics systems is a topic widely discussed in the literature. Forecasts regarding demand, supply, deliveries, and orders are a valuable source of information for the preparation of logistics plans and their implementation in an enterprise as well as for building flexible systems responding to deviations of reality from the forecast. Both short-term and long-term forecasts are important in this area as they can support the enterprise management at the operational and strategic levels, respectively [7; 8; 9; 10; 11; 12; 13; 14]. Short-term forecasts are useful in planning daily or weekly operations, while long-term forecasts are useful when planning the development of the company's infrastructure or other long-term investments [10; 11; 15]. Most quantitative methods use historical data to produce a forecast. The information regarding the expected level of demand can support decisions in the area of production,workforce planning, pricing and defining the marketing strategy. Obviously, it is not possible to construct forecasts that perfectly correspond to future events, and absolutely certain forecasts do not exist. Therefore, the methods of prediction are constantly developed and improved in order to achieve the highest possible level of precision. The vast majority of the studies available in the literature in this area are based on time series analysis. Simple models of exponential smoothing [10; 11; 16], moving average [17], and finally ARMA class models are most often used due to their high flexibility of application both to stationary and non-stationary series. For that reason, they are very popular in forecasting within a supply chain [10; 18]. However, in case of time series, a big problem involves rapid changes as well as discontinuity in demand and high seasonality, e.g., in relation to the products sold only in certain months of the year. The difficulty in finding regularities is not conducive to accurate predictions. This volatility of the market and its randomness make it necessary to implement new methods that counteract external factors. Machine learning methods have been developing dynamically recently. This is particularly due to the possibility of obtaining precise and extensive data on their functioning from logistics systems, the so-called big data [19; 20; 21]. Various methods are used in this regard, including traditional neural networks [22; 23], fuzzy neural networks [24; 25], support vector machines [26; 27], decision trees [28; 29; 30], random forests [31; 32] or k-means algorithms [33]. Machine learning results, compared to empirical data, often bring more satisfactory results [34; 35; 36], often provide more accurate forecasts and are a real alternative to time series. In addition, they are less demanding in terms of pre-processing and data processing. Nevertheless, in each case, it is necessary to take into account a certain inaccuracy of forecasts and search for such methods of logistics planning that will take into account the possibility of significant deviations of the actual results of the company from the assumed assumptions in the best possible way. In addition, it should be emphasized that even despite the not always satisfactory verifiability of the forecasts, mathematical models are still the foundation of logistics planning in enterprises so the methods of their improvement should be constantly developed. Therefore, the authors in this article proposed an alternative method that uses hidden Markov models in order to identify deliveries and they presented its implementation on the example of a manufacturing company. Thus, the following three research objectives were adopted:  
1. To propose a method for forecasting the level of subsequent supplies of raw material for production using hidden Markov models. 2. To identify the hidden states fulfilling the Markov property which describe the dynamics of raw material supplies. 3.