CN115879511A - Time series data analysis and prediction method and device based on hybrid neural network model and storage medium - Google Patents
Time series data analysis and prediction method and device based on hybrid neural network model and storage medium Download PDFInfo
- Publication number
- CN115879511A CN115879511A CN202211589133.8A CN202211589133A CN115879511A CN 115879511 A CN115879511 A CN 115879511A CN 202211589133 A CN202211589133 A CN 202211589133A CN 115879511 A CN115879511 A CN 115879511A
- Authority
- CN
- China
- Prior art keywords
- neural network
- series data
- time series
- model
- data analysis
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Abstract
The invention relates to a time series data analysis and prediction method based on a hybrid neural network model, which comprises the following steps: s1, extracting historical time sequence data, preprocessing the historical time sequence data, and dividing the preprocessed historical time sequence data into a training set and a test set; s2, constructing a plurality of neural network models with different structures; training the neural network models with different structures by utilizing the training set and the testing set; s3, extracting real-time sequence data, preprocessing the real-time sequence data, and inputting the real-time sequence data into the neural network models with different structures respectively, wherein the neural network models with different structures output respective prediction results respectively; and S4, summarizing the prediction results output by the neural network models with different structures, performing weighting processing, and outputting the final prediction result.
Description
Technical Field
The invention relates to the field of time series data analysis, in particular to a time series data analysis prediction method and device based on a hybrid neural network model and a storage medium.
Background
For data with obvious time series characteristics, the domestic common processing method is only manual processing, or only simple weighting and judgment are carried out on some key indexes, but the two processing methods obviously cannot effectively extract the key information in the time sequence and even can generate misleading effect. Some fields have begun to explore processing time series data by using a machine learning method, but the method only uses a model to carry out limited exploration on the field of the user, and the universality and the accuracy are not ideal.
Disclosure of Invention
The invention aims to provide a time series data analysis and prediction method based on a hybrid neural network model, which applies the function of giving weight to predict time series data by multi-model mixing and ensures the universality and the accuracy of the method.
In order to realize the purpose of the invention, the technical scheme is as follows:
the time series data analysis and prediction method based on the hybrid neural network model comprises the following steps:
s1, extracting historical time series data, preprocessing the historical time series data, and dividing the historical time series data into a training set and a test set;
s2, constructing a plurality of neural network models with different structures; training the neural network models with different structures by using the training set and the test set;
s3, extracting real-time sequence data, preprocessing the real-time sequence data, and inputting the real-time sequence data into the neural network models with different structures respectively, wherein the neural network models with different structures output respective prediction results respectively;
and S4, summarizing the prediction results output by the neural network models with different structures, performing weighting processing, and outputting the final prediction results.
Preferably, in step S1, the time-series data of the history are preprocessed, including missing value deleting processing and reordering processing.
Preferably, in step S1, a dropna () function of python is used to delete a row with a missing value in the historical time series data; and reordering the historical time-series data after deleting the missing values by using a reset _ index () function.
Preferably, the constructed plurality of differently constructed neural network models includes an LGBM model, an LSTM model, a Bi-LSTM model, a TabNet model, and a 1dCNN model.
Preferably, in the step S1, the historical time-series data is divided into 5 parts, and when the step S2 trains the plurality of differently-constructed neural network models, 4 parts of the plurality of differently-constructed neural network models are randomly adopted as a training set each time, and the rest are used as a test set.
Preferably, in step S1, the historical time-series data is divided into 5 parts, specifically:
inputting historical time sequence data needing to be cut and inputting the number of the time sequence data needing to be cut in a python DataFrame form; creating a new column fold, and assigning an initial value of the new column fold to-1; calculating the data volume of each cutting part by a cut () method, and rounding down by a floor () method; assigning values to different column folds according to the values given by bins variables; the bins column is deleted and the entire DataFrame is returned.
Preferably, the 1dCNN model calls a keras library of tensierflow to implement, and the activation function of the 1dCNN model is a swish function.
Preferably, the Bi-LSTM model is created by a Sequential () method, and the activation function of the Bi-LSTM model is a softmax function.
Meanwhile, the invention also provides a time series data analysis and prediction device based on the hybrid neural network model, and the specific scheme is as follows:
the device for analyzing and predicting the time series data based on the hybrid neural network model comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor executes the program to realize the method steps of the method for analyzing and predicting the time series data based on the hybrid neural network model.
In addition, the present invention also provides a computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, implements the above-mentioned method steps of the hybrid neural network model-based time series data analysis prediction method.
Compared with the prior art, the invention has the beneficial effects that:
according to the time series data analysis and prediction method based on the hybrid neural network model, provided by the invention, a plurality of neural network models with different structures are constructed and trained for subsequent prediction analysis, the prediction accuracy is improved compared with the prior art, and the method is higher in universality.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without inventive labor.
FIG. 1 is a schematic flow chart of a hybrid neural network model-based time series data analysis prediction method.
Fig. 2 is a schematic structural diagram of a time series data analysis prediction device based on a hybrid neural network model.
Detailed Description
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the embodiments described below are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example 1
The time series data analysis and prediction method based on the hybrid neural network model provided by the invention can be applied to the fields of stock analysis, music generation and the like, and as shown in fig. 1, the specific flow comprises the following steps:
s1, extracting historical time series data, preprocessing the historical time series data, and dividing the historical time series data into a training set and a test set;
s2, constructing a plurality of neural network models with different structures; training the neural network models with different structures by using the training set and the test set;
s3, extracting real-time sequence data, preprocessing the real-time sequence data, and inputting the real-time sequence data into the neural network models with different structures respectively, wherein the neural network models with different structures output respective prediction results respectively;
and S4, summarizing the prediction results output by the neural network models with different structures, performing weighting processing, and outputting the final prediction result.
In step S1, the historical time-series data is preprocessed, including missing value deletion processing and reordering processing.
In step S1, a dropna () function of python is used to delete a row with a missing value in the historical time series data, so as to train the model later; after deleting the missing row, the ordering of the data set may be changed, so the historical time series data after deleting the missing value is reordered by using the reset _ index () function.
In this embodiment, the plurality of differently configured neural network models that are constructed include an LGBM model, an LSTM model, a Bi-LSTM model, a TabNet model, and a 1dCNN model.
In step S1, the historical time series data is divided into 5 parts, and when the neural network models with different structures are trained in step S2, 4 parts of the historical time series data are randomly adopted as a training set each time, and the rest are used as a test set.
In step S1, the historical time-series data is divided into 5 parts, specifically:
inputting historical time sequence data needing to be cut and inputting the number of the time sequence data needing to be cut in a python DataFrame form; creating a new column fold, and assigning an initial value of the new column fold as-1; calculating the data volume of each cutting part by a cut () method, and rounding down by a floor () method; assigning values to different column folds according to the values given by the bins variables; the bins column is deleted and the entire DataFrame is returned.
The 1dCNN model calls a keras library of the tensorflow to realize, and an activation function of the 1dCNN model is a swish function.
The Bi-LSTM model is established by a sequential () method, and an activation function of the Bi-LSTM model is a softmax function.
The model training process includes inputting several x values, obtaining one predicted result in the forward propagation mode of adding or multiplying different parameters, calculating the loss of the model according to the difference between the predicted result and the real result after completing the input of all the rows, and regulating the parameters in the model in the backward propagation mode. In particular, this process may be repeated 2000 times to allow the model to adequately learn the characteristics of the data.
When the time series data analysis and prediction method based on the hybrid neural network model provided by the invention is applied to the field of music generation, the accuracy rate of model prediction of the next note is shown in the following table by inputting the notes of the previous period of time:
if the calculation is carried out by using the 'category Cross energy Loss', the Loss of pitch (musical note) 0.0019 and the prediction precision of duration (note time) 6.5114e-09 can be finally achieved, and the accuracy of the next note generated or predicted by the method is found to be considerable for the same style of music.
Example 2
The embodiment provides a time series data analysis and prediction device based on a hybrid neural network model, and the specific scheme is as follows:
the device for analyzing and predicting time-series data based on a hybrid neural network model, as shown in fig. 2, includes a memory, a processor and a computer program stored in the memory and operable on the processor, and the processor executes the program to implement the method steps of the method for analyzing and predicting time-series data based on a hybrid neural network model according to embodiment 1.
Example 3
The present embodiment provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor, implements the method steps of the hybrid neural network model-based time-series data analysis prediction method of embodiment 1.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one type of logical functional division, and other divisions may be realized in practice, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in the form of hardware, or may also be implemented in the form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Claims (10)
1. The time series data analysis and prediction method based on the hybrid neural network model is characterized by comprising the following steps: the method comprises the following steps:
s1, extracting historical time series data, preprocessing the historical time series data, and dividing the historical time series data into a training set and a test set;
s2, constructing a plurality of neural network models with different structures; training the neural network models with different structures by utilizing the training set and the testing set;
s3, extracting real-time sequence data, preprocessing the real-time sequence data, and inputting the real-time sequence data into the neural network models with different structures respectively, wherein the neural network models with different structures output respective prediction results respectively;
and S4, summarizing the prediction results output by the neural network models with different structures, performing weighting processing, and outputting the final prediction result.
2. The hybrid neural network model-based time series data analysis and prediction method of claim 1, wherein: in step S1, the historical time-series data is preprocessed, including missing value deletion processing and reordering processing.
3. The hybrid neural network model-based time series data analysis prediction method of claim 2, wherein: in the step S1, a dropna () function of python is adopted to delete a row with a missing value in the historical time sequence data; and the historical time series data after deleting the missing value is reordered by adopting a reset _ index () function.
4. The hybrid neural network model-based time series data analysis and prediction method according to claim 1, wherein: the constructed neural network models with different structures comprise an LGBM model, an LSTM model, a Bi-LSTM model, a TabNet model and a 1dCNN model.
5. The hybrid neural network model-based time series data analysis and prediction method of claim 4, wherein: in the step S1, the historical time series data is divided into 5 parts, and when the step S2 is used for training the neural network models with different structures, 4 parts of the historical time series data are randomly adopted as a training set each time, and the rest are used as a test set.
6. The hybrid neural network model-based time series data analysis and prediction method of claim 5, wherein: in step S1, the historical time-series data is divided into 5 parts, specifically:
inputting historical time sequence data needing to be cut and inputting the number needing to be cut in a python DataFrame form; creating a new column fold, and assigning an initial value of the new column fold to-1; calculating the data volume of each cutting part by a cut () method, and rounding down by a floor () method; assigning values to different column folds according to the values given by bins variables; the bins column is deleted and the entire DataFrame is returned.
7. The hybrid neural network model-based time series data analysis and prediction method according to claim 4, wherein: the 1dCNN model calls a keras library of the tensorflow to realize, and an activation function of the 1dCNN model is a swish function.
8. The hybrid neural network model-based time series data analysis and prediction method of claim 4, wherein: the Bi-LSTM model is created by a Sequencial () method, and an activation function of the Bi-LSTM model is a softmax function.
9. Time series data analysis prediction device based on hybrid neural network model, its characterized in that: comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein: the processor, when executing the program, implements the method steps of the hybrid neural network model-based time series data analysis prediction method of any one of claims 1-8.
10. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the method steps of the hybrid neural network model-based time series data analysis prediction method of any one of claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211589133.8A CN115879511A (en) | 2022-12-12 | 2022-12-12 | Time series data analysis and prediction method and device based on hybrid neural network model and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211589133.8A CN115879511A (en) | 2022-12-12 | 2022-12-12 | Time series data analysis and prediction method and device based on hybrid neural network model and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115879511A true CN115879511A (en) | 2023-03-31 |
Family
ID=85767039
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211589133.8A Pending CN115879511A (en) | 2022-12-12 | 2022-12-12 | Time series data analysis and prediction method and device based on hybrid neural network model and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115879511A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117331339A (en) * | 2023-12-01 | 2024-01-02 | 南京华视智能科技股份有限公司 | Coating machine die head motor control method and device based on time sequence neural network model |
-
2022
- 2022-12-12 CN CN202211589133.8A patent/CN115879511A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117331339A (en) * | 2023-12-01 | 2024-01-02 | 南京华视智能科技股份有限公司 | Coating machine die head motor control method and device based on time sequence neural network model |
CN117331339B (en) * | 2023-12-01 | 2024-02-06 | 南京华视智能科技股份有限公司 | Coating machine die head motor control method and device based on time sequence neural network model |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Knowles | ParEGO: A hybrid algorithm with on-line landscape approximation for expensive multiobjective optimization problems | |
Hastomo et al. | Characteristic parameters of epoch deep learning to predict Covid-19 data in Indonesia | |
Martinez-Jaramillo et al. | An heterogeneous, endogenous and coevolutionary GP-based financial market | |
CN111861588B (en) | Training method of loss prediction model, player loss reason analysis method and player loss reason analysis device | |
Ling et al. | Large scale learning of agent rationality in two-player zero-sum games | |
CN108846695A (en) | The prediction technique and device of terminal replacement cycle | |
CN115879511A (en) | Time series data analysis and prediction method and device based on hybrid neural network model and storage medium | |
TW201820172A (en) | System, method and non-transitory computer readable storage medium for conversation analysis | |
Miessi Sanches et al. | Ordinary least squares estimation of a dynamic game model | |
CN110956261A (en) | Method and system for determining evaluation index | |
Broniec | Guiding parameter estimation of agent-based modeling through knowledge-based function approximation | |
CN108765127A (en) | A kind of credit scoring card feature selection approach based on monte-carlo search | |
Ribeiro et al. | Importance of statistics for data mining and data science | |
Taylor et al. | On partitioning multivariate self-affine time series | |
Lukatskii et al. | Algorithms and software for studying the impact of fuel and energy prices on the economy of the Russian federation | |
Ashlock et al. | Shaped prisoner's dilemma automata | |
Ashlock et al. | Hormonal systems for prisoners dilemma agents | |
Barrett | Lithics in Perspective: Indeterminacy, Simulation, and the Formation of Lithic Assemblages | |
CN111160662A (en) | Risk prediction method, electronic equipment and storage medium | |
CN110348623A (en) | Complex Product Development time prediction and optimization method based on Design Structure Model | |
Wang et al. | Fuzzy context-dependent data envelopment analysis | |
Septiana et al. | Prediction of study period and information on judiciary in higher education using the c5. 0 algorithm | |
Lin et al. | Empirical method to measure stochasticity and multifractality in nonlinear time series | |
Martin Podesta | Optimal stopping problems and the Mean-Variance selling strategy | |
Moroz | Software tool for solving inductive modelling tasks based on self-organizing combinatorial-genetic method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |