Prediction of Basic Material Prices on Major Holidays Using Multi-Layer Perceptron

−The prediction of the price of basic necessities on major holidays in Indonesia, such as Eid al-Fitr, Christmas, New Year, Chinese New Year, and Eid al-Adha, is something that needs to be observed, because there are often movements in the prices of basic commodities that increase or decrease very drastically. One of the main ingredients experiencing this is eggs, which often experience a significant increase, so it is necessary to make observations in the form of predictions to keep control of fluctuations, especially before and after the big day occurs. In this study, predictions were made on the price of basic commodities on the big day. With the prediction of the cost of goods on the big day, it is hoped that related parties can be assisted in monitoring and stabilizing the movement of basic commodity prices on the market. In this study, a prediction system for the price of basic commodities was produced using the Multi-Layer Perceptron (MLP) method. This MLP method can predict time-series data that experiences a lot of fluctuation. In this prediction, MLP can make predictions on ten prices of basic commodities on major holidays every day. The results of this study were divided into three groups, namely Worst, Average, and Best. The division of these three groups separates which staple ingredients have the closest predictions to their actual values. The Worst group is the group whose prediction results are still quite far from the actual, the Average group which is close to the actual value, and the Best group which has the best results because it is very close to the actual value. With prediction results measured using MSE, the Worst group consisted of cooking oil (MSE 0.00197), beef (0.00186), rice (0.00118), and sugar (0.00100). Then the Average group consisted of eggs (0.00096), red chili (0.00085), chicken (0.00074), garlic (0.00062), and cayenne pepper (0.00056). Finally, the Best group only consisted of Shallots with an MSE of 0.00040.


INTRODUCTION
Basic commodities are food needs that support people's lives. Along with the times, the need for basic commodities is increasing along with the increase in population. This, of course, affects the price of basic commodities. In addition to the population, in Indonesia, the price of basic commodities can be influenced by various things. Prices of basic commodities can soar or even drop drastically at certain times. This often happens, especially on major holidays such as Eid, Christmas, and New Year [1]. There are several ways to find out when these events occur. One of which is by predicting the price of basic commodities in the future. This prediction can be made in order to suppress price spikes, especially on big days in Indonesia. The prediction may be useful to help the government suppress the price of every basic ingredient, which is likely to experience a drastic increase [2]. Making predictions on the price of basic commodities may allow the government to take preventive measures before prices spike up, with various options, one of which is to create a market operation that can guarantee price stability [3].
Several previous studies can be used as a reference in predicting the price of a commodity. For example, one paper reports a study to forecast iron ore prices [4]. This study considers several factors such as China's inflation rate, US inflation rate, USD to AUD exchange rate, crude oil prices, gold prices, silver prices. The data used in this study is iron ore price data from January 1989 to December 2018. The method used in this study is to use MLP with CGOA optimization. In this study, the CGOA-NN algorithm obtained MSE values of 0.0128, RMSE 0.1132, MAE 0.1004, and AARD 30.93. Compared with other algorithms such as PSO-NN, GA-NN, PSO-NN, GOA-NN, and Classic NN, MLP with CGOA gets the best predictive value [4]. In similar research, MLP can predict the prices of goods or commodities that often experience price fluctuations. By using the MLP method, the problem of predicting price fluctuations can be solved quite well. In [5,6,7,8], the use of MLP resulted in a good prediction for prices that often fluctuated, where one of the studies showed an error rate of 10.87%.
In a study that discusses the prediction of onion prices in Bangladesh, research on price forecasting is carried out to overcome market price volatility [9]. There are several methods used in the study for forecasting, including K-Nearest Neighbor (KNN), Naïve Bayes, Decision Tree, Neural Network (NN), and Support Vector Machine (SVM). The methods give accuracy of 88.58%, 68.84%, 97.72%, 80.14%, 98.17%, respectively. Prediction results show that the accuracy obtained by MLP shows the highest results [9]. In another study, prediction of rice price by comparing the MLP method with the Long Short-Term Memory (LSTM) method is discussed. In the study, the results of the error evaluation using RMSE on MLP were 21.14 and LSTM 0.35 [10]. On the other hand, another study also explains the prediction of broiler eggs' prices in East Jakarta. The study uses the Neural Network method and genetic algorithm, where a neural network architecture consists of 7 input layers, two hidden nodes, and one output. This study shows that the artificial neural network gives satisfactory results, which is indicated by the best RMSE value of 0.033 [2]. In [11], egg price predictions were also conducted by using the autoregressive integrated moving average (ARIMA) method. In the study, parameters regarding Religious Holidays are considered, where the MAPE result for ARIMA was 6.1%.
Based on previous research, the forecasting system with time-series data uses the MLP method is suitable for fluctuating food price data, especially on big days like what happened in Indonesia. From [4], we can see that Multi-layer Perceptron (MLP) is one type of NN model that can be used in predicting the price of a commodity. The method has been tested in [2,4,9] with a good result for predicting the price of a commodity. However, in literature, only one commodity was tested in each study, so that we do not know if this method can give us a good result in predicting commodities' prices in general.
In this paper, time-series data is used as input, where the data consist of ten basic ingredients, including eggs, chicken meat, beef, shallots, and garlic. In addition, major Holidays in Indonesia are also considered during the prediction process. In this study, the MLP architecture has a depth that has been set to get maximum results in predicting prices on major holidays in Indonesia. Figure 1 shows the flowchart of the system we made for the prediction with MLP. The first thing to do is to collect a dataset on the prices of basic commodities. Next, we need to preprocess the data that will produce features, namely by using major holidays in Indonesia that will support the prediction process so that it can produce a predictive value that matches the actual value.

Data Collection
This study collected the data from public data that the National Food Price Information Center published. The data consist of Indonesia's commodities' prices from July 2017 to August 2021. The data obtained is daily price data for various basic commodities, including eggs, chicken meat, beef, red onion, and garlic. The collected data were then carried out in the preprocessing process to match what is needed to make predictions with MLP. In this research process, the data used is data from the average price of each basic material. The sample dataset can be seen in Table 1. The data obtained in Table 1 is data in the form of time-series, a set of data collected within a certain time span [12]. This type of data is used because it can make predictions by utilizing mathematical and statistical formulas based on previous data to predict future data [13]. The data shown in Table 1 is data from [14], which gives us the average price data in all markets in Indonesia. Figure 2 shows a visualization of the daily movement of prices for staple food commodities, shallots, with the x-axis representing the number of days, and y being the price. Figure 2 shows data that tends to fluctuate, which is expected to be predicted using MLP.

Data Preprocessing
Data processing is carried out in several steps, such as adding features and splitting data. This preprocessing stage is the earliest and quite crucial stage. because at this stage, researchers must process data so that MLP can process it for price predictions [15], [16] .
The data are divided into two parts at the data separation stage, namely test data and training data. The distribution of data is carried out by year. The data from 2017 to 2019 were used as training data, while data from 2020 to 2021 were used as test data. The data to be used are the average price for each commodity, with a total of ten commodities used.
The next stage is the feature addition stage. At this stage, we check the distance between the predicted date and the existing holidays such as Chinese New Year, Eid, Christmas, Eid al-Adha, and New Year, as well as providing other features such as if it will make a prediction on day X then the data that will be used to predict it is data from the previous 30 days. Table 2 shows one of the sample data that has been processed for further processing.

Training
The classification and model formation using MLP is carried out in this training process. The data that is used as input for training is data that has been previously processed as in Table 2, with the composition of the data: 2017-2019 as training data and 2020-2021 as test data. Multi-Layer Perceptron (MLP), also known as Feed-Forward Neural Network, is an artificial neural network built with nodes or can also be called neurons interconnected with one another [17]. The connections between neurons can be represented by weights which are real numbers at the intervals illustrated as in Figure 3.   Figure 3 shows the architecture used to conduct training with the MLP method. The MLP architecture can be described as follows: the first layer is the input variable, which is symbolized as the input layer, the last layer is called the output layer, and all layers between the input and output layers are referred to as hidden layer [18]. Each MLP layer can be described mathematically as in equation (1).
In formula (1), represents the activity function of the layer identify real layers in non-input networks L, shows the number of neurons in layer , ( ) represents the actual output of neuron i in layer l, , ( ) for 1 ≤ ≤ −1 is the weight associated with the neuron i from layer l with neurons in the previous layer, namely − 1, and 0, .
( ) is a bias of the neuron i which is the real layer. The input vector is formulated as = 0 with length 0 , with input (0) = . Output vector from last layer = , with length , which is the layer of the network output, with the resulting network being ( ) = [4].
MLP algorithm can be described through a flow chart, as shown in Figure 4. In the flow chart, the network weights and biases are determined in the direction of the steepest reduction of the performance function using the mean squared error (MSE). This can provide the most efficient learning outcomes for MLP [13] In general, the training process can be illustrated in Figure 4, which shows how the MLP stages make predictions. We start with an input layer containing predetermined features in the early stages, then enter the existing hidden layer and produce the output result of prediction. If it still has an error value that is not satisfactory, then backpropagation will be carried out by changing its weight until a good value is obtained.
We used the Keras library to perform the prediction process with MLP in this study. In this training process, an architecture with hyperparameters was used as in Table 3, which has an input layer of 35 nodes with activation requirements. Then, there are three hidden layers composed of a number of nodes, including the first hidden layer consisting of 80 nodes with relu activation, hidden layer 2 has 64 nodes with relu activation, and the last hidden layer has 32 nodes with relu activation. Finally, for the output layer in this study, one node is used for the output layer. For more details, see the architecture in Figure 3.   Input Type Amount  Hidden Layer 3  Relu  32  Output Layer  Linear  1  Epochs  -500  Batch Size  -1 At this time, the training process was carried out with 500 epochs. This was done because the research showed that the 500 epochs showed satisfactory results for the training results, which will be discussed in Section 3. From the training results that have been carried out, visualization results will be obtained on the daily prices of basic commodities, as shown in Figure 5. Figure 5 is a visualization of the price prediction results for the shallot commodity during 2017-2019, From Figure 5 it can be seen that the model generated in the training process can predict well.

Testing
At this testing stage, the data used is preprocessed data from 2020 to 2021. In this training process, a validation process is carried out on the value of the results of the data training process. The value to be validated is the predicted value on major holidays in Indonesia. From the testing process that has been carried out, the results obtained can be seen in Table 4. In this table, we can see the predicted data on three commodities on one of the big days, that is Eid al-Fitr. From the data, it can be seen the difference between the prices obtained from the three main ingredients. Each table shows the price for 30 days before the big day and 30 days after the big day. For the big day, it is marked in bold.  Figure 4, which is a visualization of the price prediction results for the shallot commodity for 2020-2021. From Figure 6 it can be seen that in testing, the prediction results can follow the movement of the actual value with a graph that is already fit.

Evaluation
The evaluation aims to verify whether the deep learning model that has been made in this research is appropriate or not. Various types of evaluations can be used to verify the results obtained from deep learning models, some of which are Mean Square Error (MSE), Root Mean Square Error (RMSE), and Mean Absolute Error (MAE). The predicted value obtained will be more accurate with these calculations. Formulas (2)(3)(4) show how we can calculate the accuracy evaluations [19]. In the declaration of formula (2)(3)(4) it is known that is the number of days for which forecasting is carried out, represents the actual value, and represents the forecast value. MSE and RMSE perform calculations on the difference in values obtained from the results between the original value and the predicted value. In RMSE and MSE, if the resulting error value is close to 0, then it can be said that the prediction results are close to the actual value, which is good. For MAE, this is an evaluation that calculates the average error between the predicted value and the actual value, such as RMSE and MSE. MAE also has a good category if the calculation value is close to 0 [20].

MLP Model Scenario
This study refers to three main objectives: measuring the daily price of basic commodities, measuring the holidays in Indonesia, and measuring using ten basic commodities. From these three measurements, the price of a staple food will be predicted every day, especially on big holidays in Indonesia. Based on the results obtained, the ten prices of basic commodities are grouped into three categories: Worst, Average, and Best. The three groups were created to be able to see which staple ingredients have the highest accuracy in their prediction results.

State of The Arts
In this study, predictions using the MLP method were successfully carried out to predict prices on major holidays in Indonesia. The final result of this research is to get prediction results divided into three groups: Worst, Average, and Best groups. The three groups were formed because, in this study, the prediction results of several commodities were still far from the actual value. Still, there were also prediction results that were very close to the actual value. Therefore three groups were made to divide the results. The three groups are represented by Cooking Oil for Worst, Egg for Average Egg, and Shallots for Best, as can be seen in Figure 7.  The findings in this paper show that every prediction made on each commodity, apart from depending on the big day in Indonesia, predictions in the study are closely related to price fluctuations. The prediction will produce good results or are close to the actual value if the number of days that do not experience fluctuations is less than 50% of the total days. Still, if the days that do not experience price fluctuations are more than 50% of the total days, the prediction results produced will produce unsatisfactory results. Table 5 shows how the commodities' prices fluctuate in the data we use. Based on Table 5, it can be seen that the worst prediction group of four other commodities, including rice, cooking oil, granulated sugar, and beef. This worst prediction is the result of a prediction that is still not close to the true value. This prediction occurs because the prices of each of these staples tend to be stable every day, which can cause MLP not to be able to make good predictions. The Average group consisted of five predicted commodities: eggs, cayenne pepper, red chilli, garlic, and chicken. This Average group is a group whose results are close to the actual value. This is because this average group has a day percentage value that fluctuates more than 50%. This causes MLP to predict well because prices tend to fluctuate. For the Best group obtained by the shallot commodity, this red onion has results that are close to the actual value, as shown in Figure 7.
Based on the three groups, the results show that the Best and the Average group can predict the prices of basic commodities well on major holidays in Indonesia, while the worst group cannot predict the prices of basic commodities well, especially on big holidays in Indonesia. These results are obtained based on the process of model formation using MLP with Hyperparameters that have been made previously, with predictions that have been successful with the best MSE value is 0.000401. The model that has been made also considers the distance to holidays in Indonesia, which also affects the results of the predictions of these staples. Based on the previous explanation, it can be seen that Figure 8 shows that cooking oil as a sample from the worst group got prediction results which were still quite far from the actual value, while for the average and best group, it was close to the actual value obtained.

MLP Evaluation Result
Based on the test of ten prices of basic commodities to make price predictions, especially on major holidays in Indonesia, it can be predicted with MLP. However, the results depend on the existing price data. The results obtained from the three groups of prediction results have varied error values in each group. These results can be seen in the evaluation error results contained in Table 6 for the training results and the testing results.  From the previously used hyperparameters that produce the MLP model that has been made, an analysis can be carried out that refers to Table 6. The results obtained are based on an error evaluation which shows ideal results because there is no overfitting of the prediction results. This is because the use of the parameters in the MLP that were carried out during the training was correct. The error evaluation results show that in the training process, the error for cooking oil has the smallest value, while the error in the testing process shows that the error for cooking oil is smaller than the error value for eggs and chicken, which are included in the Average group. From the two results, cooking oil can be included in the worst group in training and worst in testing, referring to the error value obtained. However, this is unacceptable considering that the visualization of Figures 9 and 10 shows the prediction results for the big day from cooking oil show that the prediction results are still far from the actual results. This also refers to the previous finding in Table 5, that if a commodity has a fluctuating number of days of no more than 50%, it is certain that the results to be obtained will be quite far from the actual value due to the stability of commodity prices.
Based on this explanation, it can be seen that the results of the evaluation of the RMSE, MSE, and MAE matrices can be used as a reference as a determinant of whether the prediction results are good or not, and must refer to the graph of the prediction results whether the results are in accordance with the actual value or not. Figures  9 and 10 are the predicted results for the three groups of samples in training and testing. Figure 9 and Figure 10 show the results of the predictions for each sample in the three existing groups. Figure 9 shows the prediction result for training data, while Figure 10 is for testing data. From the two images, it can be seen that the Average group represented by eggs and Best by Red Onion has predictive results on every major day in Indonesia by approaching its actual value, in the sense that both groups have good results and can predict prices at the end of the big day. Meanwhile, the worst group, which is represented by cooking oil, has prediction results that are still far from the actual value, this can be seen from Figure 9 and Figure 10, which show the prediction results from cooking oil, both in training and testing still have poor results for prediction the big day in Indonesia. This is because the prices of these commodities tend to be stable.these commodities tend to be stable.
From the overall results that have been obtained, it shows that the MLP method can predict well on major holidays in Indonesia, with the prediction results being divided into three groups, from the three groups, one

CONCLUSION
In this study, it can be seen that price fluctuations that occur every day for one year can affect the prices of basic commodities, especially fluctuations that occur on holidays in Indonesia greatly affect the course of the prediction results that will be obtained. In this study, MLP can make predictions on these staples.
Based on the results of the research that has been done, it can be concluded that the prediction of the price of basic commodities on the big day using MLP can be done well and get results that are close to the actual value. The MLP algorithm used has parameters of 35 input layers with three hidden layers. The first hidden layer has a density of 80. The second hidden layer has a density of 64, and the third hidden layer has a density of 32. The relu activation layer and the output layer each consist of one layer, with linear activation.
The model made can make predictions by applying errors using MSE, RMSE, and MAE. by producing three forecasting groups, namely the Best commodities, including Shallots with an accuracy of 0.000149, 0.012216, and 0.007489, the Average commodity including eggs with an accuracy of 0.000989, 0.031451, and 0.021644, and the Worst commodity was Cooking Oil with an accuracy of 0.000647, 0.025444, and 0.020864. The experimental results use 2017-2020 as training data and 2020-2021 as training data with features namely New Year, Chinese New Year, Eid al-Fitr, Eid al-Adha, and Christmas.
The results obtained from these predictions can be influenced by price data which tends to be stable, causing poor prediction results. However, if commodity price data tends to fluctuate, the prediction results will increase much closer to the actual value. It can be determined if a commodity has days that do not experience fluctuations of more than 50% of the total data, then the prediction results will tend to be far from its value, whereas if it is less than 50%, prediction results will get very good evaluation results.
The results of this study are expected to help further researchers to make better predictions by adding several methods that can handle prices that tend to be stable, such as using the fuzzy method or other methods.