Multivariat Predict Sales Data Using the Recurrent Neural Network (RNN) Method

Recurrent Neural Network


INTRODUCTION
Prediction is a process of predicting conditions that will occur in the future based on existing data.An example of forecasting is sales results, which are used to determine the estimated sales volume so that appropriate decisions can be made based on existing data [1] [2].Sales prediction (forecasting) plays a vital role in planning and decision-making, especially in the production sector in the sales industry [3].Production and operations management activities use demand forecasting in planning related to production planning [4].
Poor sales predictions will automatically lead to inadequate production planning.As a result, inventory becomes very high or vice versa, and sales are lost due to the unavailability of goods to be sold [5].Inventory that is too high results in increased costs because existing resources become inefficient.In the opposite condition, it will cause a product vacancy on the market [6].This condition creates opportunities for competitors to enter, resulting in the loss of existing market opportunities (loss opportunity).
Prediction is a crucial element in decision-making because whether a decision is effective or not generally depends on several factors that we cannot see when the decision is made, which is based on existing and past data [7].To be able to predict sales data, time series data from the past is needed, which can be analyzed so that patterns can be formed that can predict future conditions [8].One method that can be used to predict sales data is to use the Recurrent Neural Network (RNN) model [9].
Recurrent Neural Network (RNN) has good processing time series data capabilities.Recurrent Neural Network (RNN) is a type of Neural Network architecture which, in carrying out the process, is called repeatedly to process input, which is usually sequential data [10].Sequential data has characteristics where data samples are processed in a sequence (for example, time), and samples in the sequence are closely related to each other [11].Time series sales data can be classified as sequential data because it is processed in a time sequence [12].The contribution resulting from this research is that it can recognize patterns and trends that may change over time.RNN models can help predict data and adapt to changes, including changes in consumer trends, seasonal variability, or external factors that can influence sales.Another contribution is multivariate data analysis, particularly in sales forecasting.Applying the RNN method adds an analytical framework that can be used to understand relationships between variables and make more precise predictions.
This research uses a dataset from kaggle.Kaggle is one of the world's famous Data Science and Machine Learning sites whose dataset can be downloaded in CSV format [13].Kaggle is not just a collection of datasets but consists of the largest data community.Quite a few companies have analysis problems, but they don't have the resources of skilled Data Scientists.Kaggle Data Science is beneficial as a place for research.

Methodology
In general, the steps in the sales data prediction process using Recurrent Neural Network (RNN) are as follows:

2 Data Preprocessing
Preprocessing in research includes data normalization.Before processing, the input data will be normalized.Data normalization is carried out so that the network output matches the activation function used [14].The data used in this research was taken from Kaggle.The total data used is 12 data, namely sales data for the last four months of 2020.The following is an example of sales data in 2020.

2.1 Forming Time Series Data
The sales data in Table 1 is converted into time series data with input variables and target variables [15].The initial step in the process of creating sales data prediction time series data is to create a data series from day 1 to day 12, initialed with X1, and the output is from day 2 to day 11, initialed with Y.The time series data can be seen in Table 2 as follows.

2.2 Data Normalization
The time series data in Table 2 is normalized according to the range between 0 and 1 to adjust the activation function [16].The normalization technique used uses min-max scaling.The following is a normalization calculation using the min-max scaling normalization formula.This normalization will be carried out continuously from the 11th to the 22nd so that the normalization results can be seen in

2.3 Data Sharing
The amount of data used is 12 data, namely sales data for the last four months, data in the form of sales from Kaggle [17].For example, manual calculations in this research use sales data in February 2020, where there were the most sales.Of the 11 data, 80% will be used for training data, and 20% will be used for testing data, where the amount of training data is 11 x 80% = 9 data which is the amount of data to be used in training data and 11 x 20% = 2 data which is the amount of data to use for test data.The data distribution of 80%:20% in this study can be seen in Table 3.4 and Table 3.5 below.The purpose of dividing training data and test data is so that the learning algorithm can learn from patterns that have been obtained from the results of the training process, which will be implemented in the testing data [18] [19].The training and testing process using the RNN method will continue until an optimal model is obtained.

Method Analysis
The next stage is method analysis.The method used in this research is Recurrent Neural Network (RNN).The architecture of the Recurrent Neural Network Method can be seen in Figure 2 below.a.The input data is sales data for 2020 from the 11th to the 22nd of February, which is then initialized with X1.Meanwhile, B1 is the initialization for the bias value from the input to the hidden layer, and B2 is the initialization for the bias value from the hidden layer to the output layer.Input variables can be seen in Table 6 below.a) The input value will be normalized first before being input.Then, it will be passed to the hidden layer.Next, from the hidden layer to the context layer and back again to the hidden layer.In the picture above, Z is symbolized as a neuron in the hidden layer, and M is represented as the context layer.b) Each neuron in the input layer and output layer will be connected to the hidden layer via weights and a binary sigmoid activation function.c) After that, each parameter is given a value, including the weight value w1, weight value w21, and bias value, then the calculation process is carried out.d) The output weight produced from the hidden layer will be passed to the output layer, which consists of 1 output initialized with the letter Y.

RESULTS AND DISCUSSION
The following are the results of the Python program displayed from Google Colabs using the Python programming language in classifying lighting product data that has been completed and produced output by the expectations of the study site.In Figure 3, there is a visual dataset before it is labeled and a visual dataset that has been marked, which will be displayed in table form in Excel, to which the raw Excel dataset is attached.
After labeling and displaying the data that was previously hidden in columns or tables, the tagged data was obtained as many as 12,290.The following is a dataset that has been labeled in the form of a visual table.This can be seen in Table 4.Then, the initial process carried out is the Excel dataset import page, where on this page, the dataset import is carried out using pandas.If some columns or attributes are not used, for example, only have a NULL value, then the column can be deleted.Only those that have a value are used because not all The data have value in the dataset.The function of na del df is to delete data that has no value.This page is the result of the classification of goods labels for best-selling lighting products, which can be seen comprehensively for items that are categorized as best-selling after being successfully classified into two categories.This page results from the K-Nearest Neighbor (K-NN) classification of labels for nonselling lighting products, which can be seen comprehensively for items categorized as not selling after they have been successfully classified.This a page that displays product graphs in 2 label categories, namely the best-selling label and the not-best-selling label, where the best-selling lighting products have been successfully classified as 12,420 items categorized as selling well and as many as 6,870 items categorized as not selling well, from the total lighting product dataset.With a total of 19,290 data.4. CONCLUSIONS The conclusion of this research is to answer the problem formulation that has been presented, namely that the author succeeded in classifying 19,290 lighting products using the Python programming language using Google Collabs.Of the 19,290 items organized, the graphic results showed that 12,420 were categorized as best-selling items., and as many as 6,870 were classified as not selling well.
Based on the conclusions of the results of the research that has been carried out, along with suggestions that the author can convey, for the sake of developing further research, this can be done by changing the type of distance used and can be created by increasing the amount of data and variables, so that better algorithm accuracy results can be obtained.

𝑋𝑛
=0 -/ −  Information : x : normalized data x΄ : data after normalization min : minimum value of all data max : the maximum value of all data

Figure 10 .
Figure 10.Classification Results for Non-Selling Products

Figure 11 .
Figure 11.Graphic results for classification of lighting products.

Table 2 .
Time Series Data

Table 3 .
Time Series Data Normalization Results

Table 5
Description of neural network parameter