A machine learning pipeline for forecasting time series in the banking sector
Abstract
EconStor is a publication server for scholarly economic literature, provided as a non-commercial public service by the ZBW.
Full text
Gorodetskaya, Olga; Gobareva, Yana; Koroteev, Mikhail Article A machine learning pipeline for forecasting time series in the banking sector Economies Provided in Cooperation with: MDPI – Multidisciplinary Digital Publishing Institute, Basel Suggested Citation: Gorodetskaya, Olga; Gobareva, Yana; Koroteev, Mikhail (2021) : A machine learning pipeline for forecasting time series in the banking sector, Economies, ISSN 2227-7099, MDPI, Basel, Vol. 9, Iss. 4, pp. 1-15, https://doi.org/10.3390/economies9040205 This Version is available at: https://hdl.handle.net/10419/257363 Standard-Nutzungsbedingungen: Die Dokumente auf EconStor dürfen zu eigenen wissenschaftlichen Zwecken und zum Privatgebrauch gespeichert und kopiert werden. Sie dürfen die Dokumente nicht für öffentliche oder kommerzielle Zwecke vervielfältigen, öffentlich ausstellen, öffentlich zugänglich machen, vertreiben oder anderweitig nutzen. Sofern die Verfasser die Dokumente unter Open-Content-Lizenzen (insbesondere CC-Lizenzen) zur Verfügung gestellt haben sollten, gelten abweichend von diesen Nutzungsbedingungen die in der dort genannten Lizenz gewährten Nutzungsrechte. Terms of use: Documents in EconStor may be saved and copied for your personal and scholarly purposes. You are not to copy documents for public or commercial purposes, to exhibit the documents publicly, to make them publicly available on the internet, or to distribute or otherwise use the documents in public. If the documents have been made available under an Open Content Licence (especially Creative Commons Licences), you may exercise further usage rights as specified in the indicated licence. https://creativecommons.org/licenses/by/4.0/
economies Article A Machine Learning Pipeline for Forecasting Time Series in the Banking Sector Olga Gorodetskaya, Yana Gobareva and Mikhail Koroteev * Citation: Gorodetskaya, Olga, Yana Gobareva, and Mikhail Koroteev. 2021. A Machine Learning Pipeline for Forecasting Time Series in the Banking Sector. Economies 9: 205. https:// doi.org/10.3390/economies9040205 Academic Editor: Ralf Fendel Received: 27 September 2021 Accepted: 8 December 2021 Published: 20 December 2021 Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. Copyright: © 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/). Department of Data Analysis and Machine Learning, Financial University under the Government of the Russian Federation, 125167 Moscow, Russia; [email protected]u (O.G.); [email protected]u (Y.G.) *Correspondence: [email protected] or mvkor[email protected] Abstract: The problem of forecasting time series is very widely debated. In recent years, machine learning algorithms have been very prolific in this area. This paper describes a systematic approach to building a machine learning predictive model for solving optimization problems in the banking sector. A literature analysis on applying such methods in this particular area is presented. As a direct result of the described research, a universal scenario for forecasting various non-stationary time series in automatic mode was developed. The developed scenario for solving specific banking tasks to improve business efficiency, including optimizing demand for ATMs, forecasting the load on the call center and cash center, is considered. A machine learning methodology in economics that can yield robust and reproducible results and can be reused in solving other similar tasks is described. The methodology described in the article was tested on three cases and showed the ability to generate models that are superior in accuracy to similar predictive models described in the literature by at least three percentage points. This article will be helpful to specialists dealing with the problem of forecasting economic time series and students and researchers due to a large number of links to systematic literature reviews on this topic. Keywords: machine learning; artificial neural networks; data mining; ATMs; time series forecasting; load forecasting; service optimization 1. Introduction In recent years, the banking service market has been characterized by the development of an ATM network, since in the modern world, ATMs are considered one of the priority ways to distribute banking services and expand the client portfolio, which is an excellent advantage for any bank. A truly ramified network of ATMs is not only one of the practical tools for developing the infrastructure of the retail business but also contributes to a significant increase in the bank’s profitability. Time series modeling is a fairly popular area in the banking sector. One of these tasks is the problem of predicting the optimal amount of loaded cash in ATMs with proper planning and cash flow management. It is possible to minimize the costs of servicing cash flows, for example, by increasing the interval between ATM collections (collection period), to reduce the costs of collector services and to relieve the cash departments. Moreover, the sudden use of all cash in ATMs leads to downtime, reducing the efficiency of using the ATM network and, consequently, the bank’s profit. However, along with developing a network of ATMs for working with cash, additional problems include loading cash, choosing the denomination of the notes required for issuing, choosing the desired currency, and routing the accepted notes. Due to many objects of forecasting, there is an acute issue of developing a universal algorithm and forecasting methodology. The application of a time series methodology adequately reflects the construction of the model when solving the problems of analysis and forecasting in the ATM network. This article proposes a method and shows its application to several tasks. Economies 2021,9, 205. https://doi.org/10.3390/economies9040205 https://www.mdpi.com/journal/economies
Economies 2021,9, 205 2 of 15 2. Related Work Many studies are devoted to applying machine learning methods for problems of forecasting time series. The most developed areas of application include stock market forecasting (Aliev et al. 2004), trading system development (Dymowa 2011), and practical examples of market forecasting (Kovalerchuk and Vityaev 2006) using machine learning models. Bahrammirzaee (2010) reviewed research on financial forecasting and planning and other financial applications using various artificial intelligence techniques such as artificial neural networks (ANNs), expert systems, and hybrid models. For example, evolutionary algorithms find many applications in forecasting economic and financial time series (Chen 2002); multipurpose evolutionary algorithms have been widely studied for various economic applications, including time series forecasting (Tapia and Coello Coello 2007; Ponsich et al. 2013;Aguilar-Rivera et al. 2015). Li and Ma examined implementations for stock price forecasting and some other financial applications (Li and Ma 2010). Tkáˇc and Verner (2016) investigated various implementations of ANN in financial applications, including for predicting stock prices. Recently Elmsili and Outtaj investigated applications of ANNs in economic and management research, including series forecasting (Elmsili and Outtaj 2018). There are many systematic reviews on specific applications of financial time series forecasting. The dominance of forecasting financial and stock markets is traced in this area. Several predictive stock market research reviews have been published based on various soft computing methods at different times (Nair and Mohandas 2014;Cavalcante et al. 2016; Atsalakis and Valavanis 2009). Chatterjee et al. (2000), Katarya and Mahajan (2017) focused on ANN-based financial market predictive studies, while (Hu et al. 2015) focused on machine learning (ML) implementations for inventory forecasting and algorithmic trading models. In another application for time series forecasting, researchers have reviewed studies on forex forecasting using ANN (Hewamalage et al. 2021) and various other soft computing methods (Pradeepkumar and Ravi 2018). Note that in all the variety of financial and economic applications of time series forecasting methods, insufficient attention is paid to more specific problems (Sezer et al. 2020) , such as forecasting the ATM load, which is the subject of this article. However, this does not mean that this problem has not been considered in the literature (Ekinci et al. 2019). We note, for example, the works of M. Rafi, which are devoted to modeling ATM loading using classical statistical methods such as moving average autoregression (Rafi et al. 2020) and the use of recurrent neural networks based on LSTM cells (Asad et al. 2020). LSTM can generally be considered a classical method since it was created specifically for modeling time series. Therefore, it often finds application in this problem (Arabani and Komleh 2019; Serengil and Ozpinar 2019;Rong and Wang 2021). Also, classical and deep learning methods were applied to this problem, the performance comparison of which are given in Vangala and Vadlamani (2020) and Hasheminejad and Reisjafari (2017). However, an analysis of the literature shows that classical machine learning methods such as regression analysis (Rajwani et al. 2017), support vector machines (Jadwal et al. 2018), dynamic programming (Ozer et al. 2019), ARIMA (Khanarsa and Sinapiromsaran 2017), and gradient boosting (Shcherbitsky et al. 2019) are used much more often. Mention should be made of the research work carried out based on the database of the NN5 competition (Adeodato et al. 2014), since this competition is very closely related to our work. The dataset in this competition contains two years of daily cash withdrawals from 111 ATMs in the UK. The challenge is to predict ATM withdrawals for each ATM over the next 56 days. The most efficient model, from Andrawis et al. (2011), an ensemble of general Gaussian regression, neural network, and linear models, achieved a SMAPE of 18.95%. The article by Venkatesh et al. (2014) improved the prediction accuracy of Andrawis et al. (2011) by clustering similar ATMs and applying many popular neural networks. These studies show that modern ML algorithms for forecasting time series produce results better than classical
Economies 2021,9, 205 3 of 15 methods. Also, one of the advantages of that work is taking into account the particular clusters to which an ATM belongs, which improves the quality of the demand forecast. In another work, Kamini et al. (2014) further improved the results by simulating chaos in cash withdrawal time series and referring to popular neural network architectures. However, the study did not include the effects of exogenous traits, such as the “day_of_week” dummy, whether it is a weekday or a weekend, as these traits significantly impact forecast accuracy. Information regarding whether the day corresponds to a working day or a weekend is relevant to the problem under study. Ekinci et al. (2015) considered the problem of optimizing ATM cash replenishment in Istanbul using simple linear regression with grouping. They have achieved a MAPE score of 22.69% on average. Catal et al. (2015) used the same dataset, NN5, as the aforementioned papers and exponential smoothing to achieve the average SMAPE of 21.57%. None of the articles reviewed above discuss the importance of identifying and marking periodic anomalies in time series related to optimizing the management of cash flows in bank ATMs. However, the correct marking of periodic anomalies is necessary for the efficient generation of the feature space and to build a predictive model. This is one of the critical points in this work—considering the influence of periodic anomalies associated with regularly recurring events. However, Fremdt (2015) explores the methodology for detecting anomalies in time series using the CUSUM method and shows its applicability to financial data (value of stock prices). Therefore, the results obtained by Fremdt in the article on marking anomalies by this method is applicable in this work. 3. Problem Statement Historically, the classical time series methods have been econometric models such as AR, MA, ARMA, ARIMA, SARIMA, exponential smoothing, triple exponential smoothing, e.g., (Katarya and Mahajan 2017;Sezer et al. 2020;Arabani and Komleh 2019). Several disadvantages characterize these models. Although the models of the autoregressive class (ARIMA and its modifications) show pretty good quality in solving real problems, there are serious shortcomings which prompted the need to develop other methods that compensate for the shortcomings of the previous ones. The following disadvantages can be distinguished: (1) The predictive period. A significant drawback of some models is that the prediction period is limited to a few points, which is unacceptable in the absolute majority of applied problems (Andrawis et al. 2011). (2) Data preprocessing and preparation. Autoregressive models are based on the assumption that the original time series is stationary, which contradicts reality in actual data. As a result, researchers have to spend much time making the time series stationary for such models. This problem is especially acute when the number of time series exceeds hundreds and thousands. Respectively, it becomes difficult to look for a way to make each time series stationary (Draper and Smith 1998;Yohannes and Webb 1999). (3) Computational complexity. Almost all the models listed above need to select a certain number of parameters, and the more complex the model, the more parameters in it need to be tuned (Draper and Smith 1998;Yohannes and Webb 1999; Morariu et al. 2009). Consequently, this imposes limitations on the performance of the forecasting system itself. Table 1provides a comparison of time series forecasting models by several criteria (Andrawis et al. 2011;Venkatesh et al. 2014;Draper and Smith 1998;Morariu et al. 2009).
Economies 2021,9, 205 4 of 15 Table 1. Comparison of time series forecasting models. Criteria Regression Autoregressive Exp. Smoothing Decision Trees Neural Network Flexibility and adaptability +− − +− Ease of choice of architecture, the need to select parameters + + − − − Ability to simulate nonlinear processes − − + + + Model learning rate + − − +− Consideration of categorical features: − − − + + Training set requirements N ND N −N Where: N—denotes that data should be normalized. S—denotes that it is required to bring the series to a stationary form. The criterion “Flexibility and adaptability” means: “+”—models are flexible and adapt when the distribution of the target value changes1; “ − ”—models are inflexible and do not adapt with a sharp change in features because they are tied to the parameters of seasonality. With a sharp change in the distribution of the target value, retraining is required. The criterion “Ability to simulate nonlinear processes” means: “+”—non-linear connections are taken into account. “−”—linear relationships only. The criterion “Model learning rate” means: “+”—fast (comparable to SVM in computational complexity). “−”—the method is computationally intensive (comparable to ANN in complexity). The criterion “Consideration of categorical features” means: “+”—taken into account. No conversion required. “ − ”—not taken into account, it is required to carry out transformations (for example, One-hot-encoder2or label encoder3). Based on the comparative analysis of the data of model approaches, it can be concluded that there is no uniform approach to forecasting all types of time series. The methods used differ for stationary and non-stationary time series. The choice of a model is often based on a preliminary visual assessment of the data in question. If a time series has a trend, then regression models show the best predictive ability, and exponential smoothing models show the best predictive ability for series with a pronounced seasonality. Given the specificity of time series in the banking sector, such as their non-stationarity for the most part, as well as their large number, it is necessary to apply forecasting methods based on modern machine learning (decision trees, random forest, gradient boosting over decision trees, neural networks). These methods will solve several problems in forecasting time series in the banking sector. First, there is no need to waste time converting the original series to a stationary form. Secondly, given a large number of time series (for example, each time series for a separate ATM, and there are many such ATMs, approximately 200,000), we claim that it is possible to create a universal pipeline applicable to forecasting a large number of time-series.
Economies 2021,9, 205 5 of 15 Thus, this study aims to optimize the management of cash flows in bank ATMs. The primary solution method is the development of a universal methodology for automating the stages associated with the automatic generation of the feature space, anomaly detection, selection of hyperparameters, and training models. In conducting this research, a software product in Python was developed. We have used a sample of observations of a behavioral model of an ATM for 2016–2019 as the training dataset to test the resulting model. The application of the developed approach was tested on several cases with the interpretation of the importance of the features of the models making it possible to determine the strength and influence of each of the features of the forecast. 4. Methods The specific stages described below that make up the predictive model production methodology were developed following the staging of typical machine learning projects designed to solve similar problems. Examples of describing the stages of data analysis for creating predictive models can be seen in previous studies (Morariu et al. 2009; Bahrammirzaee 2010;Li and Ma 2010;Nair and Mohandas 2014;Katarya and Mahajan 2017;Sezer et al. 2020;Asad et al. 2020;Arabani and Komleh 2019;Kamini et al. 2014). A universal pipeline for forecasting time series was developed to solve the problem of forecasting, consisting of the following steps: 4.1. Formation of a Feature Space For any machine learning algorithm, a feature space is required. An extensive feature space typical for time series includes: • One-hot encoding of calendar features (day of the week, month, weekend, holiday, reduced working day, etc.). •Lagged variables (time series values for previous days). • Rolling statistics grouped by calendar features (average, variance, minimum, maximum, etc.). •Events of massive payments (advance payment, salary, etc.). The selection of the necessary parameters (window width in statistics, the number of lags) and the selection of significant features are performed for each time series individually using cross-validation in a sliding window. 4.2. Anomaly Detection Anomaly detection plays an essential role in time series analysis and forecasting. Training on a time series with many outliers can significantly reduce the prediction accuracy. Anomalies can be classified into two types: •Periodic anomalies. •Anomalies that do not have a periodicity. The first class can be used as an element of the feature space for further forecasting, while the second can be excluded from the sample. CUSUM (cumulative sum) is a method that tracks variations in a process (time series) (Aue et al. 2012). It is based on the accumulation of changes in the time series from the mean. As soon as the cumulative sum exceeds the specified threshold value, this point is marked as an anomaly. The detection process is carried out through iterative learning and prediction with a moving window (Fremdt 2015). The method parameters indicated below are calculated on the training set, and anomalies are detected on the test set. Mathematical interpretation: S+ i=0, S+ i+1+xi−(µ+dri f t ∗σ) S− i=0, S− i−1+xi−(µ−dri f t ∗σ) Anomalies =1i f S+ i>threshold·σor S− i<−threshold·σ, 0 otherwise
Economies 2021,9, 205 6 of 15 where: S+ i—the upper limit of the cumulative sum. S− i—the lower limit of the cumulative amount. xi—values of the time series in the test window. µ—the average of the time series in the learning window. σ—standard deviation of the time series in the learning window. dri f t—is the number of standard deviations to summarize the changes. threshold—the number of standard deviations for the threshold value. The CUSUM anomaly detection algorithm also helps to identify periodic emissions determined by the days of massive payments: salary, advance payment, pension, etc., and its recursive application in a sliding window helped us to extract significant and relevant signs of relevant events. Proper labeling of the periodic anomalies is necessary for efficient generation of the feature space for the subsequent construction of a forecast. For example, we analyzed the actual values of the demand sums by days of the month for three years for two ATMs. The visualization of anomalies and their distribution is shown in Figure 1. Economies 2021, 9, x FOR PEER REVIEW 6 of 15 𝑆—the lower limit of the cumulative amount. 𝑥—values of the time series in the test window. 𝜇—the average of the time series in the learning window. 𝜎—standard deviation of the time series in the learning window. 𝑑𝑟𝑖𝑓𝑡—is the number of standard deviations to summarize the changes. 𝑡ℎ𝑟𝑒𝑠ℎ𝑜𝑙𝑑—the number of standard deviations for the threshold value. The CUSUM anomaly detection algorithm also helps to identify periodic emissions determined by the days of massive payments: salary, advance payment, pension, etc., and its recursive application in a sliding window helped us to extract significant and relevant signs of relevant events. Proper labeling of the periodic anomalies is necessary for efficient generation of the feature space for the subsequent construction of a forecast. For example, we analyzed the actual values of the demand sums by days of the month for three years for two ATMs. The visualization of anomalies and their distribution is shown in Figure 1 Figure 1. Visualization of anomalies and their distribution by day of the month. For many anomalies, the noise in the search for periodic values is weaker than the signal. The first anomalies were marked as the transfers (weekends, holidays) and were removed from the original series. Then the search algorithm was rerun. In this problem to be solved, it was revealed that the peak values of the anomalies were on the 10th and 11th of each month, which were interpreted as salary days. There was also a less pronounced anomaly on the 25th. This was explained by the fact that this is an advance, significantly less than the basic salary. 4.3. Feature Selection Feature selection is performed in a greedy way (Das and Kempe 2011). All possible subsets of the feature space were enumerated. In this case, all possible subsets of the feature space were considered and 2 n−1 options were obtained (without an empty set). It is worth noting that such a feature selection method is computationally laborious. Therefore, parallelization of computations for all processors is built into this method. When selecting features, cross-validation was used for the time series, the central meaning of which was sequential movement along with the time series, increasing the training sample. In this case, the number of folds for dividing the sample was taken as being equal to five. As a result, we obtained a histogram of the importance of features, where the x-axis was the contribution and influence of each feature on the forecast, and the y-axis lists the features that affected the forecast (Figure 2). Figure 1. Visualization of anomalies and their distribution by day of the month. For many anomalies, the noise in the search for periodic values is weaker than the signal. The first anomalies were marked as the transfers (weekends, holidays) and were removed from the original series. Then the search algorithm was rerun. In this problem to be solved, it was revealed that the peak values of the anomalies were on the 10th and 11th of each month, which were interpreted as salary days. There was also a less pronounced anomaly on the 25th. This was explained by the fact that this is an advance, significantly less than the basic salary. 4.3. Feature Selection Feature selection is performed in a greedy way (Das and Kempe 2011). All possible subsets of the feature space were enumerated. In this case, all possible subsets of the feature space were considered and 2 n−1 options were obtained (without an empty set). It is worth noting that such a feature selection method is computationally laborious. Therefore, parallelization of computations for all processors is built into this method. When selecting features, cross-validation was used for the time series, the central meaning of which was sequential movement along with the time series, increasing the training sample. In this case, the number of folds for dividing the sample was taken as being equal to five. As a result, we obtained a histogram of the importance of features,
Economies 2021,9, 205 7 of 15 where the x-axis was the contribution and influence of each feature on the forecast, and the y-axis lists the features that affected the forecast (Figure 2). Economies 2021, 9, x FOR PEER REVIEW 7 of 15 Figure 2. Histogram of the importance of features (see Table 2). Table 2. The main features of the model. Feature Name Description min_month the minimum demand for a month std_month monthly demand standard deviation median_month monthly demand standard deviation lag_3 the amount of demand three days before the forecast point rolling_min_weekday the minimum demand value for two days of the same past (on two Tuesdays, on two Wednesdays) lag_2 the amount of demand two days before the forecast point rolling_median_weekday demand median for two days of the same past (on two Tuesdays, on two Wednesdays) rolling_median weekly medial demand value rolling_median weekly medial demand value rolling_min the minimum demand value for the week rolling_std_weekday weekly standard deviation from the demand point lag_7 the amount of demand seven days before the forecast point max_month the maximum demand for the past month mean_month the average demand for the past month lag_4 the amount of demand four days before the forecast point lag_5 the amount of demand five days before the forecast point lag_1 the amount of demand one day before the forecast point rolling_mean average monthly demand value rolling _std weekly demand standard deviation rolling _max_weekday the maximum demand value for two of the same past days of the week (on two Tuesdays, on two Wednesdays) lag_6 the amount of demand six days ago rolling_max maximum demand value for the week rolling_mean_weekday the average demand for two days of the same past (on two Tuesdays, on two Wednesdays) It can be seen from the histogram that the larger the value, the more influential the feature is in the model. The selection of features was carried out by maximizing the objective function of the error for all possible combinations of features. In problems with a small Figure 2. Histogram of the importance of features (see Table 2). Table 2. The main features of the model. Feature Name Description min_month the minimum demand for a month std_month monthly demand standard deviation median_month monthly demand standard deviation lag_3 the amount of demand three days before the forecast point rolling_min_weekday the minimum demand value for two days of the same past (on two Tuesdays, on two Wednesdays) lag_2 the amount of demand two days before the forecast point rolling_median_weekday demand median for two days of the same past (on two Tuesdays, on two Wednesdays) rolling_median weekly medial demand value rolling_median weekly medial demand value rolling_min the minimum demand value for the week rolling_std_weekday weekly standard deviation from the demand point lag_7 the amount of demand seven days before the forecast point max_month the maximum demand for the past month mean_month the average demand for the past month lag_4 the amount of demand four days before the forecast point lag_5 the amount of demand five days before the forecast point lag_1 the amount of demand one day before the forecast point rolling_mean average monthly demand value rolling _std weekly demand standard deviation rolling _max_weekday the maximum demand value for two of the same past days of the week (on two Tuesdays, on two Wednesdays) lag_6 the amount of demand six days ago rolling_max maximum demand value for the week rolling_mean_weekday the average demand for two days of the same past (on two Tuesdays, on two Wednesdays)
Economies 2021,9, 205 8 of 15 It can be seen from the histogram that the larger the value, the more influential the feature is in the model. The selection of features was carried out by maximizing the objective function of the error for all possible combinations of features. In problems with a small number of features, this technique is a reasonable choice since it allows one to select the most optimal set of features in the foreseeable computational time. Of course, with an increase in the number of features in the initial data, this method becomes inapplicable due to its exponential asymptotics. This feature selection technique is resistant to a specific set of features in the input data and therefore was preferred as the most universal. 4.4. Building Models Models based on ensembles of decision trees are used to build forecasts using a random forest and gradient boosting over decision trees. The models were implemented using the sklearn, xgboost, lightgbm, and catboost libraries (Lundberg and Lee 2017; Slack et al. 2020) . The choice of the best modeling method was carried out for a given time series in cross-validation. For most machine learning problems, it is customary to assert the independence of observations. However, for a time series, this assumption about the independence of observations is incorrect since the subsequent values of the series depend on the previous values. Therefore, the cross-validation process for time series is different. The model is trained at some interval of the series from the initial point of the series in time to some value of t. Then a forecast is made for the horizon n. For the interval of the series from t to t + n, the error on this fold is calculated. Further, the training sample increases from the starting point of the series to the point t + n. Forecasting is carried out for the horizon n, that is, for the series interval from t + n to t + 2 × n and so on until the end of the sample is reached. The number of folds is calculated as the number of row intervals n that fit from the start to the end of the row. This approach is commonly referred to in the literature as “sliding window cross-validation” (Cerqueira et al. 2020). 4.5. Selection of Hyperparameters It is necessary to select hyperparameters to improve the quality of predictive models. A grid is set to select the optimal values of hyperparameters (Cartesian product of all fitted parameters). The selection method is carried out to select the combination that gave the best quality in the cross-validation sample. This approach has traditionally been used in machine learning and is called grid search (Claesen and De Moor 2015). However, this approach is computationally laborious regarding time and memory, especially if the number of objects for forecasting is too large since it must retrain the model for the entire sample at each iteration. Also, this approach does not consider the results of previous iterations. Another approach to selecting hyperparameters is the application of Bayesian optimization (Baptista and Poloczek 2018). It should be noted that this approach has shown itself well in practice. The essence of this approach lies in the fact that the best hyperparameters are predicted and selected based on the experiments already carried out, and not just the given values of the hyperparameters are enumerated. So, as the first step, let us assume that the quality of the model is a Gaussian process from hyperparameters. The initialization of hyperparameters is randomly selected. At step n, the first step is to select the next point xnaccording to (1): xn=argmaxxZ∞ f(ˆ x)(f(x)−(ˆ x)) ×p(f|x)(1) where: x—set of model hyperparameters. f(x) —our current guess.
Economies 2021,9, 205 15 of 15 Venkatesh, Kamini, Vadlamani Ravi, Anita Prinzie, and Dirk Van den Poel. 2014. Cash demand forecasting in ATMs by clustering and neural networks. European Journal of Operational Research 232: 383–92. [CrossRef] Yohannes, Yisehac, and Patrick Webb. 1999. Classification and Regression Trees, CART: A User Manual for Identifying Indicators of Vulnerability to Famine and Chronic Food Insecurity. Washington, DC: International Food Policy Research Institute. Available online: https://play.google.com/store/books/details?id=7iuq4ikyNdoC (accessed on 15 December 2021).