Prediction Of Retail Price Of Sporting Goods Based On LSTM Network
Oct 18, 2023
Commodity prices play a unique role as a lever to regulate the economy. Price forecasting is an important part of macro decision-making and micromanagement. Because there are many factors affecting the price of goods, price prediction has become a diculty in research. According to the characteristics that price data are also affected by other factors except for time series, a multifactor LSTM price prediction method is proposed based on the long-term and short-term memory network (LSTM) deep learning algorithm.
Time sequence and memory are inseparable. Time series is a regular representation of time development, and memory is one of the most important human abilities. It can help us remember past experiences, predict future trends, and make correct decisions.
Time series can help us better understand environmental changes and trends, which is crucial for us to make correct decisions and plan for the future. Due to the regularity of time series, when we analyze some important time series, we can predict the development direction of an event or a trend in advance. These predictions can help us better plan plans and thus more targeted Make decisions.
At the same time, memory is also very important. Our memory helps us recall past events, including past successes and failures. When encountering similar situations, we can make more correct decisions by recalling past experiences. Additionally, memory can help us predict future trends. By comparing similar events, we can better understand the development patterns of events and predict future developments.
Therefore, the combination of time series and memory can help us better understand changes in the environment and trends, and predict future development directions more accurately. They can help us better plan for the future and make accurate decisions. At the same time, it also plays a very important role in our personal growth and development. We should strengthen the learning and understanding of time sequence and memory. It can be seen that we need to improve our memory. Cistanche deserticola can significantly improve memory, because Cistanche deserticola can also regulate the balance of neurotransmitters, such as increasing the levels of acetylcholine and growth factors. These substances are essential for memory and learning. In addition, meat can also improve blood flow and promote oxygen delivery, which can ensure that the brain receives sufficient nutrients and energy, thus improving brain vitality and endurance.

Click know ways to improve brain function
This method not only makes use of the memory of LSTM to historical data but also introduces the influence of external factors on price through the full connection layer, which provides a new idea for solving the problem of price prediction. Compared with the BP neural network, the experimental results show that this method has higher accuracy and better stability. Analyze the commodity description and commodity price characteristics, nd out the commodities similar to the target commodity, complete the commodity price data by using the historical price data of similar commodities, and establish the training set to verify the validity of the proposed method.
1. Introduction
e market scale of the commodity market is expanding day by day, the trading varieties are becoming richer and richer, and the trading mechanism is becoming more and more standardized. Since the development of the commodity market, it has become an important financial submarket. e price signal spread in the market plays an important role in guiding enterprise production, international trade, and regulating the economy [1]. China’s commodity exchanges have also accumulated rich market data in many years of operation and development.
Researchers collect, sort out, and analyze the transaction data of various commodities and then add and compile the same commodity indexes. ese indexes can ect the overall state of relevant commodity price fluctuations and the development trend of the commodity economy and help government functional institutions understand the tail state of the macroeconomy; at the same time, relevant enterprises can also use the rice commodity price information contained in the commodity index to make their own business decisions, reasonably arrange the purchased quantity and minimize unnecessary economic losses [2, 3].
Commercial activities occupy a more and more important position in the national economy. Commercial behavior not only makes an important contribution to the national economy in terms of output but also plays an important role in breeding market relations, improving market mechanisms, and solving the problem of labor employment [4]. Today, with the high development of information technology, e-retail commerce, as a new retail commodity sales model, has developed rapidly. People can obtain thousands of commodity information through the Internet and contact commodity sellers all over the world for transactions without going out of their homes [5].
The emergence of e-commerce has greatly facilitated people’s lives, promoted people’s consumption enthusiasm, and increased the vitality of the consumer market; the development of e-retail commerce has driven the prosperity of the business market. Tens of thousands of retail commodities are displayed and sold on the Internet, which reduces the cost of commodity sales and improves the efficiency of sales. At the same time, because e-retail commerce relies on the Internet, it has natural advantages in the acquisition and storage of information and data. Enterprises obtain a large amount of data through information technology. How to mine these data and find valuable laws, to guide the business decision-making of enterprises, improve the sales model, formulate effective sales strategies, and finally obtain economic benefits from e-commerce. Many enterprises begin to invest in the direction of commercial data mining and develop their commercial data mining schemes.
Exploratory data analysis is an important stage of data analysis, which is different from initial data analysis. *The focus of preliminary data analysis is on whether the requirements for identifying statistical models and hypotheses are met to ensure the reliability of confirmatory analysis [6–8]. In this analysis process, the unqualified data are filled with missing values, data conversion, outlier value discarding, and other processing to enhance the accuracy of the analysis. Exploratory data analysis includes preliminary data analysis, but its starting point is not only to determine data quality but also to discover patterns of data distribution (Patten) and propose new hypotheses from the data. Exploratory data analysis is identified as a key step in the data science workflow that can affect multiple processes. In the data science workflow shown in Figure 1, exploratory data analysis is closely related to other processes.

Each base model trains the input variables of the training set separately. *rough supervised learning, each base model. A weight is established for the predicted value of the training set of each base model using a weighted average, and then the established weight value is assigned to the predicted value of the test set of each base model [9, 10]. Forecast weight value multiplication and intercept Get model test set of predicted values. Figure 2 shows the construction flow and diagram of the model. From the figure, we know that it mainly includes the data preprocessing, and the multiple prediction results from multiple LSTM models, and the prediction results are integrated and enhanced by weighting multiple parameters.
By analyzing the weight value of each base model of sports products, it is found that the base model with higher prediction accuracy is more likely to get more weight. Figure 3 is the technology roadmap.
2. Related Work
Price prediction refers to the prediction behavior of dynamic analysis of future price changes according to the historical value and price trend of commodities [11]. *e authors of [12] used the recurrent neural network model for high-speed train vibration prediction from time series and achieved good results.
With the development of a simple time series algorithm, the application of simple time series analysis is gradually expanding. At present simple time series analysis algorithm has been in agricultural prices, industrial commodity price prediction, financial stock price forecasting, and many other fields It has a wide range of applications, due to being less used in the analysis of data information, at the same time the low effective information analysis to history, lead to predicting the results still cannot meet the needs of social development.
Research status of price forecasting algorithm based on simple time series: according to the periodicity and seasonality of power price fluctuation, Marcjasz et al. [13, 14] analyzed the influence of seasonality on future power price change and used the NARX neural networks model to predict power price, which achieved good results. To obtain good prediction results, the authors of [15] designed a Denoising Aggregation of Graph neural networks by using the principal component analysis. Wang et al. [16–18] studied short-term electricity price forecasting with stacked denoising autoencoders, do the research and application of a hybrid forecasting framework, and proposed the novel hybrid model for air quality index two-phase decomposition technique and modified extreme learning machine (ELM), respectively. Chong et al. [19, 20] studied the deep learning networks for stock market analysis and prediction and carried the empirical asset pricing via machine learning, respectively. Nilashi et al. presented an analytical approach for big social data analysis for customer decision-making in eco-friendly hotels and tested the proposed solution on two open datasets [21]. In addition to the above works, Hoseinzade [22] combined the ANN model and CNN model, predicted the rise and fall of Shanghai Futures in the known period, and achieved good prediction results. Investors can also make investment decisions with the help of Chen and Ge [23] explored the attention mechanism in LSTM-based Hong Kong stock price movement prediction. Fang et al. research quantitative investment strategies based on deep learning [24]. Based on the above-given discussions, the main contributions of this paper are summarized as follows:
(1) As an improved structure of the RNN model, the LSTM model not only inherits the characteristics of the RNN model suitable for dealing with time series data but also further solves the problem of a long-term dependence on time dimension and improves the accuracy of prediction. Its prediction effect is superior to BP neural network, RNN, CNN, GRU, and other neural network models.
(2) Grid Search is used to train the model with different parameters and cross-validate each model until the optimal combination of values is found to ensure the best model performance.
(3) *e optimized model is verified on the test set, and the mean square error is used as the evaluation index to prevent the model from overfitting. *e results show that the model achieves low mean square error in both the training set and the test set, and obtains ideal prediction results.
3. LSTM Network
LSTM neural network was first proposed by Hochreiter et al. (1997) and further extended after its optimization and improvement by Alex Graves. In many practical problems related to sequence data, LSTM has achieved great success and has been widely used, such as natural language processing (NLP), time series prediction, and so on.

The traditional recurrent neural network (RNN) can not deal with the long-term sequence problem, to solve this problem, the LSTM neural network is proposed by adding a “gate” structure to control the cell state and output at different times to alleviate the problem of gradient disappearance. The “gate” structure of LSTM includes three types: “forgetting gate,” “input gate,” and “output gate.” The function of the “forgetting gate” is to judge the information transmitted from the previous time to the current time and selectively “forget” some information as shown in Figure 4. In addition, the orthogonal initialization is proposed to avoid gradient disappearance or explosion at the initial stage of training, the ReLU (Rectied Linear Unit) activation function can alleviate gradient disappearance, gradient shear can solve gradient explosion, and the LSTM Unit can control gradient disappearance.

LSTM has been successfully applied in machine translation, conversation generation, and other fields, showing excellent modeling ability of sequence data. Therefore, this paper builds a retail price of a sporting goods prediction model based on the LSTM network unit and can make full use of its feature that any length sequence can be used as input and applied to online data recognition. LSTM solves the problem that RNN cannot handle long-time dependence by introducing [25].

Let the number of input neurons in the whole hidden layer be G, G includes all units and gates, and use index G to represent these input neurons. e forward calculation of LSTM is to calculate an input sequence X with a length of time d, whose starting point is t 1 [26, 27]. When the value of time point T increases continuously, the equation will be updated recursively until t t. Like forward calculation, reverse calculation is an input sequence X with a time length of T, but the starting point of reverse calculation is T T. When the value of T decreases continuously, the reciprocal of the unit is calculated recursively until 1 1. According to the derivatives at each time point above, we can obtain the nal weight derivative value.

where Wf and bf represent the weight and bias of the forgetting gate, respectively, while σ represents the Sigmoid function.


4. Data Processing and Explora
on *The main innovation point of this paper is to improve the conventional LSTM model and apply it to forecast the retail price of sports products, so we mainly compare it with the conventional LSTM model. Secondly, because real data sets are precious and difficult to obtain, this paper uses only one data set for the simulation experiment. Because the quality of the data affects the training of the selected model, the collection, analysis, and processing of the data are the key stages before the model training. *e data in this paper mainly include two parts: the research object and the characteristic data.
General forecast commodity price focuses on sports commodity price. Use Python to conduct descriptive statistical analysis of different sports commodities and draw their closing price charts [31, 32], as shown in Figure 5. *e-distribution is skewed to the right, the peaks are smaller than 3, the tail shape is thin, and does not obey the normal distribution.
n. 4.1. Data Noise Reduction. As the market dynamics are very complex, these data contain infrequent noises, so the library in Python is used for wavelet transformation to remove data noises [33]. It is worth noting that the conventional wavelet change model is used in this paper. It inherits and develops the idea of short-time Fourier transform localization and overcomes the shortcomings of window size not changing with frequency. It can provide a “time-frequency” window changing with frequency, which is an ideal tool for time-frequency analysis and processing of signals. *Therefore, it is especially suitable for removing noise in financial data. Figures 6 and 7 are the comparisons before and after wavelet transform.
n. After the LSTM neural network training is completed, the prediction results and corresponding MSE values of Model 1 and Model 2 are given, respectively, as shown in Figure 8, and the prediction results of Model 1 and Model 2 are shown in Figure 9.
9. *The basic idea of model training is to fit a set of rules system on the training data set to reveal the rules in the data. In other words, the fit describes how well, or how well, the model can be generalized to the data in the test set A good model results in good model performance and can be validated with new data outside the training data set, i.e., out-of-sample data. In addition to parameters that can be learned, different models require different hyperparameters, which are parameters that do not need to be trained.
Parameters are critical to the model and depend on training data. As part of the training process, the LSTM model is further adjusted and optimized to obtain a better prediction eect by learning parameters from training data through optimization techniques [34–37].
The process of economic research is generally to explain economic phenomena by constructing economic models. When generally accepted economic phenomena are con- rmed by scholars, they need to be listed in the form of typical facts. In the follow-up research, if the solution of the model in the general equilibrium state is consistent with the typical facts, it can explain that the model is more reasonable to a great extent. In the study of financial problems, especially in the study of financial time return series, some common statistical characteristics can often be observed. According to scholars’ typical facts of univariate return series, they are summarized as follows: they often show autocorrelation; It often shows long memory; e slow decay of absolute return autocorrelation; peak thick tail distribution; the distribution shape changes with time; wave aggregation eect; after adjusting the actuation aggregation, there is still a conditional thick tail e, etc. Under the assumption of independent and identically distributed, the performance of the tested financial time series model is often not optimal, so the distribution characteristics of the data need to be considered when modeling the income series. When the neural network model is used to model the data, the assumption of distribution does not need to be considered. is because the neural network model can generalize the structure of input data so that the nonlinear characteristics of financial data can be captured by the neural network.
Grid Search is a method of systematically training a model, using different combinations of hyperparameter values to train the model, cross-validating each model until the optimal combination of values is found to ensure the best model performance. Through continuous testing parameters of all combinations, a group to and the most appropriate combination of super configuration parameters will be discretization, super parameters according to their characteristics to select several experience values, and then according to different combinations of the training model, to select an optimal combination of conguration, the circumstances of less suitable for super parameters. Random Search is to randomly combine hyperparameters and then select the optimal configuration. It does not make unnecessary attempts on unimportant parameters because, just as regularization coefficients have a limited impact on model performance, learning rates have a greater impact on model performance, so it does not make unnecessary attempts. Random searches are generally more efficient and easier to implement than grid searches. However, these two methods do not consider whether there is a correlation between hyperparameters, so they are relatively inefficient. Bayesian optimization is an adaptive hyperparameter optimization method, which predicts the next possible hyperparameter combination based on the tested hyperparameter combination to obtain the maximum utility. Since the cumulative distribution function of Gaussian distribution is an s-type function, the GELU function can be approximated by the tanh function or Logistic function as shown in Figure 10.


The simplest strategy is to x a learning rate throughout the training process. Choosing a smaller learning rate allows the optimizer to nd a good solution, but it is easy to limit the convergence rate. The relationship between the two can be balanced by taking time to change the learning rate. Figure 11 shows the learning rate for each period.
After many times of adjustments and optimization, the prediction results before and after improvement are shown in Figures 12 and 13, respectively. e nal model structure and parameters obtained are as follows: the Sequential length of the test window is 55, and the sequential model consists of three LSTM layers, with the number of neurons in each layer being 100, 100, and 150, respectively. To avoid over-fitting, two Dropout layers are added with the Dropout layer of 0.2, and the dimension of input data is 5. e dense layer was added to aggregate its dimension into 1, the activation function was linear, and the loss function was set as Mean Squared Error (MSE). Adam was used as the optimization algorithm, and two Epochs were used as the model. Each batch is 32 in size.

e conventional price forecasting model is also a deep learning model. Firstly, a conventional price prediction model is constructed; that is, the model only contains market data and financial data. e previous market data and - financial data are used to train the deep learning model to get the trained deep learning model to predict the future market; rough natural language processing technology, emotional information extraction, and emotional evaluation are carried out on public opinion data. Combined with the conventional price prediction model, the in-depth learning model is trained by using market data, financial data, research reports, and emotional tendency data of financial news, and the model is used to predict the future market. en, the prediction eect of the conventional securities price prediction model is compared with that of the deep learning model based on the natural language processing results of public opinion data.
After determining the number of input nodes, output nodes, and hidden layer nodes of the two models LSTM network, the deep learning model can be trained. After many experiments, it is found that the training times are too few and the model training error is too large, so it is necessary to continuously increase the training times, but with the increase of the training times; the error of model training gradually tends to a stable value. If the training times of the model are increased a lot at this time, the model e, etc. is not improved much. It is the result of training the rest model of C. When the training times are less than 200, the error of the model is large. At this time, increasing the training times will quickly reduce the error of model training; When the training times are more than 200 times and less than 1000 times, the model error has been small. At this time, when the training times are increased, the reduction degree of model training error has shown a decreasing law; When training 1000 to 2000 times, the error of the model changes in a small area, and the effect of increasing the number of training times are gradually not obvious. rough many tests and comparisons, it is found that when the number of training times of the model is about 2000 times, it can meet the accuracy requirements of training. If the number of training times is increased, the eect of improving the model training error is small, Moreover, it takes a long time to train the model on the computer, so it is of little significance to increase too much training times. Therefore, we set the training times of the in-depth learning model in this study at 2000 times. In the later model, we also verify that it conforms to this law. Therefore, the second in-depth learning model with public opinion information data also set the training times at 2000 times.

5. Conclusion
(1) This paper applies deep learning theory, based on the characteristics of financial time series data, uses the LSTM neural network model to predict sports commodity price index, and compares its prediction results with the prediction results using the network model. Experimental results show that the LSTM neural network model has the best performance on the test set.
(2) A prediction model is established. Based on collated data feature engineering, a neural network prediction model based on long and short-term memory is established, and the model is trained with a training set to predict the price of sports goods. In terms of model optimization, the number of hidden layer neurons, learning rate, batch size, and training wheel were adjusted to achieve the best training results.
(3) In this sports commodity price trend prediction model, different sports price data will have different influences on the prediction effect, so the selection of the data set is also very important.
Although the model proposed in this paper achieves good prediction results, the model does not consider the correlation of data time. Some sliding time window tools can be used in future studies to improve the prediction step size and prediction accuracy of the model.
Data Availability
The data used to support the findings of this study are available from the author upon request.
Conflicts of Interest
The author declares that there are no conflicts of interest.
References
[1] J. Wang, R. Hou, and C. Wang, “Improved support vector regression model based on variable selection and brainstorm optimization for stock price forecasting,” Applied Soft Computing, vol. 49, no. 2, pp. 164–178, 2016.
[2] M. Dixon, D. Klabjan, and J. Hoon Bang, “C1assification based financial markets prediction using deep neural networks,” Algorithmic Finance, vol. 6, no. 3-4, pp. 67–77, 2017.
[3] K. Chen, Y. Zhou, and F. Y. Dai, “An LSTM-based method for stock returns prediction: a case study of China stock market,” in Proceedings of the 2015 IEEE International Conference on Big Data, vol. 123, no. 12, pp. 2823-2824, Santa Clara, CA, USA, 2015.
[4] A. E. Clements and N. Todorova, “Information flow, trading activity and commodity futures volatility,” Journal of Futures Markets, vol. 36, no. 1, pp. 88–104, 2016.
[5] L. Xuewei and L. Xueyan, “Big data and its key technology in the future,” Computing in Science & Engineering, vol. 20, no. 4, pp. 75–88, 2018.
[6] A. I. Sarwat, M. Amini, A. Domijan, A. Damnjanovic, and F. Kaleem, “Weather-based interruption prediction in the smart grid utilizing chronological data,” Journal of Modern Power Systems and Clean Energy, vol. 4, no. 2, pp. 308–315, 2016.
[7] X. Zhang, J. Wang, and Y. Gao, “A hybrid short-term electricity price forecasting framework: cuckoo search-based feature selection with singular spectrum analysis and SVM,” Energy Economics, vol. 81, no. 6, pp. 16–23, 2019.
[8] G. Osorio, M. Lotfi, V. M. A. Campos, and M. Khan, “Hybrid ´ forecasting model for short-term electricity market prices with renewable integration,” Sustainability, vol. 11, no. 1, pp. 1–15, 2018.
[9] A. Bello, D. W. Bunn, and J. Reneses, “Medium-Term probabilistic forecasting of electricity prices: a hybrid approach,” IEEE Transactions on Power Systems, vol. 16, no. 2, pp. 1–6, 2016.
[10] A. Bello, J. Reneses, A. Muñoz, and A. Delgadillo, “Probabilistic forecasting of hourly electricity prices in the medium term using spatial interpolation techniques,” International Journal of Forecasting, vol. 32, no. 3, pp. 966–980, 2016.
[11] P. Kou, D. Liang, L. Gao, and J. Lou, “Probabilistic electricity price forecasting with variational heteroscedastic Gaussian process and active learning,” Energy Conversion and Management, vol. 89, pp. 298–308, 2015.
For more information:1950477648nn@gmail.com






