Prediction model training method and device, electronic equipment, medium and product
The original data is reconstructed and processed through dynamic modal decomposition method, extracted its evolutionary features, solving the error problem caused by manual preprocessing, and improving the accuracy of the prediction model.
Patent Information
- Application Number
- CN202411584284.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-02-14
AI Technical Summary
In the prior art, when the original data of the training model is manually preprocessed, artificial errors are easily introduced, resulting in low accuracy of the prediction model.
The original data is reconstructed and processed by dynamic modal decomposition method to extract the evolutionary characteristics of the data, thereby automatically pre-processing and reducing human error.
Automatically extract features through dynamic modal decomposition method, which improves the prediction accuracy of the prediction model and avoids the influence of artificial errors.
Smart Images

Figure CN119443215A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a training method, device, electronic device, medium and product for a prediction model. Background Art
[0002] With the rapid development of data analysis and artificial intelligence technology, modeling and prediction of the dynamic behavior of complex systems has become increasingly important. Through modeling and prediction, prediction results can be obtained in specific business scenarios, and the prediction results can effectively guide the execution of business.
[0003] In the related art, a prediction model can be trained and then used to predict the prediction results. In order to improve the accuracy of the prediction model, the original data of the training model can be preprocessed manually so that the obtained prediction model is suitable for the corresponding business scenario.
[0004] However, manual preprocessing will introduce human errors, resulting in low accuracy of the prediction model. Summary of the invention
[0005] The embodiments of the present application provide a prediction model training method, device, electronic device, medium and product to improve the accuracy of the prediction model.
[0006] In a first aspect, an embodiment of the present application provides a method for training a prediction model, comprising: receiving a training request, the training request comprising multiple original data corresponding to multiple historical time points of a target object; according to the training request, reconstructing the multiple original data by a dynamic mode decomposition method to obtain multiple reconstructed data, the reconstruction processing being used to extract evolution characteristics of the multiple original data according to evolution feature vectors of the multiple original data; training a preset model by using the multiple reconstructed data to obtain a target prediction model, the target prediction model being used to predict prediction results corresponding to the target object at future time points.
[0007] In a possible implementation, the multiple original data are reconstructed by a dynamic modal decomposition method to obtain multiple reconstructed data, including: determining multiple modes and multiple eigenvalues corresponding to the multiple original data by a dynamic modal decomposition method, the multiple modes representing the evolutionary eigenvectors of the multiple original data at multiple historical time points, and the multiple eigenvalues representing the time evolution type corresponding to each mode respectively; determining an initial time coefficient based on the data at the first time point among the multiple original data, the initial time coefficient representing the initial state of the evolution of the multiple original data at the first time point; for any mode, determining the product of the initial time coefficient and the corresponding eigenvalue as the target time coefficient corresponding to the mode, the target time coefficient representing the evolution trend of the corresponding mode; reconstructing the multiple original data by the multiple modes, the multiple eigenvalues, and the target time coefficient corresponding to each mode to obtain the multiple reconstructed data.
[0008] In a possible implementation, the multiple original data are reconstructed using the multiple modes, the multiple eigenvalues, and the target time coefficient corresponding to each mode to obtain the multiple reconstructed data, including: for any historical time point, determining the contribution value of the multiple modes to the evolution trend at the time point according to the multiple modes, the multiple eigenvalues, and the target time coefficient corresponding to each mode; and determining the multiple reconstructed data according to the contribution value corresponding to each historical time point.
[0009] In a possible implementation, the method further includes: determining a plurality of intermediate data according to a contribution value corresponding to each historical time point; determining an error value according to the plurality of intermediate data and the plurality of original data; and if the error value is less than an error threshold, determining the plurality of data as the plurality of reconstructed data.
[0010] In a possible implementation, a preset model is trained multiple times using the multiple reconstructed data to obtain a target prediction model, including: dividing the multiple reconstructed data into a training set and a test set; determining training parameters; training the preset model multiple times using the training parameters and the reconstructed data in the training set to obtain multiple intermediate models; backtesting the multiple intermediate models using the reconstructed data in the test set to obtain an intermediate loss function value corresponding to each intermediate model; until any intermediate loss function value is less than or equal to a loss function threshold, the corresponding intermediate model is determined as the target prediction model.
[0011] In a possible implementation, the preset model is trained using the training parameters and the reconstructed data in the training set to obtain the multiple intermediate models, including: dividing a validation set from the multiple reconstructed data; training the preset model multiple times using the training parameters and the reconstructed data in the training set, and screening using the reconstructed data in the validation set to obtain the multiple intermediate models.
[0012] In a possible implementation, the method further includes: determining multiple weights corresponding to the multiple intermediate models based on the intermediate loss function value corresponding to each intermediate model; and fusing the multiple intermediate models based on the multiple weights to obtain the target prediction model.
[0013] In a second aspect, an embodiment of the present application provides a training device for a prediction model, comprising: a receiving module for receiving a training request, wherein the training request includes multiple original data corresponding to multiple historical time points of a target object; a reconstruction module for reconstructing the multiple original data according to the training request by a dynamic mode decomposition method to obtain multiple reconstructed data, wherein the reconstruction processing is used to extract evolution characteristics of the multiple original data according to evolution feature vectors of the multiple original data; a training module for training a preset model through the multiple reconstructed data to obtain a target prediction model, wherein the target prediction model is used to predict the prediction results corresponding to the target object at future time points.
[0014] In a possible implementation, the reconstruction module is specifically used to determine multiple modes and multiple eigenvalues corresponding to the multiple original data through a dynamic modal decomposition method, the multiple modes represent the evolutionary eigenvectors of the multiple original data at multiple historical time points, and the multiple eigenvalues respectively represent the time evolution type corresponding to each mode; the reconstruction module is also specifically used to determine the initial time coefficient based on the data at the first time point among the multiple original data, and the initial time coefficient represents the initial state of the evolution of the multiple original data at the first time point; the reconstruction module is also specifically used to determine, for any one mode, the product of the initial time coefficient and the corresponding eigenvalue as the target time coefficient corresponding to the mode, and the target time coefficient represents the evolution trend of the corresponding mode; the reconstruction module is also specifically used to reconstruct the multiple original data through the multiple modes, the multiple eigenvalues, and the target time coefficient corresponding to each mode to obtain the multiple reconstructed data.
[0015] In a possible implementation, the reconstruction module is specifically used to determine, for any historical time point, the contribution values of the multiple modes to the evolution trend at the time point according to the multiple modes, the multiple eigenvalues, and the target time coefficient corresponding to each mode; the reconstruction module is also specifically used to determine the multiple reconstructed data according to the contribution value corresponding to each historical time point.
[0016] In a possible implementation, the device also includes: a judgment module, used to determine a plurality of intermediate data according to a contribution value corresponding to each historical time point; the judgment module is also used to determine an error value according to the plurality of intermediate data and the plurality of original data; the judgment module is also used to determine the plurality of data as the plurality of reconstructed data if the error value is less than an error threshold.
[0017] In a possible implementation, the device also includes: an execution module, used to divide the multiple reconstructed data into a training set and a test set; the execution module is also used to determine training parameters; the execution module is also used to train the prediction model multiple times using the training parameters and the reconstructed data in the training set to obtain multiple intermediate models; the execution module is also used to backtest the multiple intermediate models separately using the reconstructed data in the test set to obtain the intermediate loss function value corresponding to each intermediate model; the execution module is also used to determine the corresponding intermediate model as the target prediction model until any intermediate loss function value is less than or equal to a loss function threshold.
[0018] In a possible implementation, the execution module is specifically used to divide a validation set from the multiple reconstructed data; the execution module is also specifically used to train the prediction model multiple times using the training parameters and the reconstructed data in the training set, and to screen the reconstructed data in the validation set to obtain the multiple intermediate models.
[0019] In a possible implementation, the device also includes: a fusion module, used to determine multiple weights corresponding to the multiple intermediate models based on the intermediate loss function value corresponding to each intermediate model; the fusion module is also used to fuse the multiple intermediate models based on the multiple weights to obtain the target prediction model.
[0020] In a third aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor;
[0021] The memory stores computer-executable instructions;
[0022] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementations of the first aspect.
[0023] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect above and / or various possible implementations of the first aspect.
[0024] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above first aspect and / or various possible implementation methods of the first aspect.
[0025] The training method, device, electronic device, medium and product of the prediction model provided in the embodiments of the present application include: receiving a training request, wherein the training request includes multiple original data corresponding to multiple historical time points of the target object; according to the training request, reconstructing the multiple original data by a dynamic mode decomposition method to obtain multiple reconstructed data, wherein the multiple reconstructed data, the reconstruction processing is used to extract the evolution characteristics of the multiple original data according to the evolution feature vectors of the multiple original data; training the preset model multiple times by the multiple reconstructed data to obtain a target prediction model, wherein the target prediction model is used to predict the prediction results corresponding to the target object at future time points. The above scheme can automatically pre-process the original data through the method of dynamic mode decomposition to avoid errors introduced by humans, thereby improving the prediction accuracy of the prediction model. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0027] Figure 1 A schematic diagram of an application scenario of a network access method provided in an embodiment of the present application;
[0028] Figure 2 A flowchart of a network access method provided in an embodiment of the present application;
[0029] Figure 3 A flowchart of a network access method provided in an embodiment of the present application;
[0030] Figure 4 A schematic diagram of the preparatory work for reconstruction provided in an embodiment of the present application;
[0031] Figure 5 A schematic diagram of the reconstruction process provided in an embodiment of the present application;
[0032] Figure 6 A schematic diagram of model fusion provided in an embodiment of the present application;
[0033] Figure 7 A schematic diagram of the structure of a network access device provided in an embodiment of the present application;
[0034] Figure 8 A schematic diagram of the structure of a network access device provided in an embodiment of the present application;
[0035] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0036] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0037] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0038] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0039] In addition, this application involves big data analysis of user information (including but not limited to personal biometrics, identity data, consumption data, asset data, electronic terminal operation data, etc.), and the use of artificial intelligence technology for automated decision-making, and a technical solution for making decisions that have a significant impact on personal rights and interests based on the results of automated decision-making. The application provides users with corresponding operation entrances for them to choose to agree or reject the results of automated decision-making; if the user chooses to reject, the expert decision-making process will be entered.
[0040] Figure 1A schematic diagram of a scenario of a training method for a prediction model provided in this application, such as Figure 1 As shown, the original data is preprocessed to obtain training data, and the model is trained through the training data to obtain the target prediction model.
[0041] Exemplarily, the preprocessing process may include extracting features related to the prediction target from the original data, and constructing training data through the features so that the prediction results of the target prediction model meet the prediction target.
[0042] In the related art, features related to the prediction target are extracted from the original data manually.
[0043] In combination with the above scenarios, it can be seen that in related technologies, features may not be accurately extracted or noise data may not be accurately removed by manual methods, resulting in low accuracy of the target prediction model.
[0044] The prediction model training method provided in this application automatically extracts features related to the prediction target through the technical means of dynamic mode decomposition, thereby avoiding human errors and improving the prediction accuracy of the prediction model.
[0045] It should be noted that the method and device for training the prediction model of the present application can be used in the field of artificial intelligence technology, and can also be used in any field outside the field of artificial intelligence technology. The application field of the method and device for training the prediction model of the present application is not limited.
[0046] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0047] Figure 2 A flowchart of a prediction model training method provided in an embodiment of the present application, the method comprising the following steps:
[0048] S201: Receive a training request, where the training request includes multiple original data corresponding to multiple historical time points of a target object.
[0049] The target object has a time evolution law. The original data is time series data. The time series data is a set of data points arranged in time sequence, and each data point contains a timestamp and an observation value.
[0050] Combined with the scenario example, there is an evolutionary law between the observed values of multiple data points and the timestamps of multiple data points. For example, as the timestamp increases, the observed values show an overall upward trend. Or as the timestamp increases, the observed values show a periodic change trend.
[0051] S202: According to the training request, reconstruct the multiple original data by using a dynamic mode decomposition method to obtain multiple reconstructed data.
[0052] The reconstruction process is used to extract the evolution features of the plurality of original data according to the evolution feature vectors of the plurality of original data.
[0053] Among them, Dynamic Mode Decomposition (DMD) is a mathematical technique for analyzing and modeling complex dynamic systems, and is particularly suitable for extracting low-dimensional dynamic patterns from high-dimensional data. The basic idea of DMD is to extract a set of spatial patterns (i.e. modes) and corresponding temporal dynamics (i.e. eigenvalues) from time series data. These modes and eigenvalues can be used to describe the dynamic behavior of the system and help identify and understand the dominant modes and time evolution characteristics of the system.
[0054] Exemplarily, the original data may include valid data, invalid data, or irrelevant data. Among them, the valid data contains a regular trend related to the prediction target. The invalid data may be abnormal data, noise data, repeated data, or inconsistent data. The trend contained in the irrelevant data is irrelevant to the prediction target.
[0055] Combined with the scenario examples, the evolutionary characteristics are as follows: for example, the observation value of the original data shows a long-term upward trend with the increase of the timestamp, the observation value shows a short-term downward trend with the increase of the timestamp, and the observation value shows a cyclical downward trend with the increase of the timestamp. Compared with the original data, the reconstructed data has obvious evolutionary characteristics.
[0056] S203: Train the preset model using multiple reconstructed data to obtain a target prediction model.
[0057] Among them, the target prediction model is used to predict the prediction results corresponding to the target object at a future time point.
[0058] Exemplarily, the preset model of the present application can be an extreme gradient boosting tree model. Among them, the extreme gradient boosting tree (Extreme Gradient Boosting, referred to as XGBoost) builds a strong learner by combining multiple weak learners (usually decision trees). It performs multiple optimizations on the basis of gradient boosting, so that the model has significant improvements in performance and efficiency. XGBoost uses multi-threading and distributed computing to significantly improve the training speed. XGBoost reduces memory usage through internal optimization, so that the model can run efficiently on large-scale data sets. XGBoost introduces a regularization term to prevent overfitting by controlling the complexity of the model.
[0059] Exemplarily, the target prediction model obtained through training can identify the evolution law of the original data and predict the prediction results at future time points based on the evolution law.
[0060] Combined with scenario examples, the training and application processes of the target prediction model are not affected by human factors, thereby improving the accuracy of the prediction.
[0061] The training method of the prediction model provided in the embodiment of the present application receives a training request, the training request includes multiple original data corresponding to multiple historical time points of the target object; according to the training request, the multiple original data are reconstructed by the dynamic mode decomposition method to obtain multiple reconstructed data, and the multiple reconstructed data are used to extract the evolution characteristics of the multiple original data according to the evolution feature vectors of the multiple original data; the preset model is trained multiple times by the multiple reconstructed data to obtain the target prediction model, and the target prediction model is used to predict the prediction results corresponding to the target object at future time points. The above scheme can automatically pre-process the original data through the dynamic mode decomposition method to avoid errors introduced by humans, thereby improving the prediction accuracy of the prediction model.
[0062] Based on any of the above embodiments, Figure 3 , the detailed process of training the prediction model is explained.
[0063] Figure 3 A flowchart of a prediction model training method provided in an embodiment of the present application. Figure 3 As shown, the method includes:
[0064] S301: Receive a training request, where the training request includes multiple original data corresponding to multiple historical time points of a target object.
[0065] It should be noted that the execution process of S301 refers to S201 and will not be repeated here.
[0066] S302: Determine multiple modes and multiple eigenvalues corresponding to multiple original data by using a dynamic mode decomposition method.
[0067] Among them, multiple modes represent the evolution feature vectors of multiple original data at multiple historical time points, and multiple eigenvalues represent the time evolution type corresponding to each mode.
[0068] Exemplarily, each mode represents a specific dynamic behavior. The eigenvalue is a complex number corresponding to the mode, which represents the growth or decay rate and oscillation frequency of the mode. The real part of the complex number of the eigenvalue represents the growth or decay rate of the mode. A real part greater than 1 indicates growth, and a real part less than 1 indicates decay. The imaginary part of the eigenvalue represents the oscillation frequency of the mode.
[0069] Combined with the scenario example, for example, the evolutionary eigenvector represents the long-term trend, and the corresponding eigenvalue is λ=1.02+0.02i, where the real part 1.02 is greater than 1, indicating that the long-term trend is slowly increasing, and the imaginary part 0.02 indicates that the mode has slight oscillations. For example, the evolutionary eigenvector represents seasonal changes, and the corresponding feature is λ=0.95+0.2i, where 0.95 is less than 1, indicating that the seasonal changes are gradually weakening, and the imaginary part 0.2 indicates that the mode has strong oscillations, reflecting seasonal fluctuations.
[0070] Optionally, multiple modes and multiple eigenvalues are determined by constructing an initial matrix.
[0071] Exemplarily, multiple historical time points corresponding to multiple original data and multiple feature dimensions corresponding to each historical time point are determined, and an initial matrix is created according to the multiple historical time points and the multiple feature dimensions corresponding to each historical time point.
[0072] The multiple historical time points cover each timestamp included in the original data. The data of each historical time point may contain multiple feature dimensions, each of which represents a specific measurement or attribute.
[0073] Combined with the scenario example, the initial matrix is constructed from multiple raw data. Each row of the data matrix represents a time point, and each column represents a feature dimension. The initial matrix is subjected to singular value decomposition to extract the mode, and the eigenvalue is calculated through the initial matrix.
[0074] Based on the above implementation methods, comprehensive multidimensional analysis can be performed through multiple feature dimensions to accurately determine the comprehensive status of the original data at different time points, and organize the data of multiple historical time points and multiple feature dimensions into a matrix form, making the data more structured and easier to manage and process.
[0075] S303: Determine an initial time coefficient according to the data of the first time point among the plurality of original data.
[0076] The initial time coefficient represents the initial state of the evolution of multiple original data at the first time point.
[0077] Among them, the first time point is the earliest timestamp corresponding to the original data, and the initial time coefficient reflects the state of the original data at the initial moment.
[0078] Exemplarily, the initial time coefficient is a vector, specifically representing the weight or importance of each mode at the first time point. By calculating the initial time coefficient, the initial state of the evolution of the original data at the first time point, that is, the dynamic behavior of the original data at the beginning, can be understood.
[0079] Combined with the scenario example, the initial conditions are the basis for the dynamic behavior of the original data. Knowing the initial state can better predict and understand the behavior of the original data at subsequent time points. Different initial conditions will lead to significant differences in the evolution path of the system.
[0080] S304: For any mode, determine the product of the initial time coefficient and the corresponding eigenvalue as the target time coefficient corresponding to the mode.
[0081] Among them, the target time coefficient represents the contribution value of the evolution trend of the corresponding mode pair.
[0082] Combined with the scenario example, for any mode, the eigenvalue is λ=1.02+0.02i, the initial time coefficient is 0.8, and the corresponding target time coefficient is 0.816+0.016i calculated by multiplying, where 0.816 represents the growth rate of the mode at subsequent time points, and 0.016 represents the oscillation frequency of the mode at subsequent time points. The growth rate and oscillation frequency can represent the evolution trend of the mode.
[0083] Next, combine Figure 4 Describe the preparations for reconstruction.
[0084] Figure 4 A schematic diagram of the preparatory work for reconstruction provided in the embodiment of the present application. Figure 4 As shown, the original data is dynamically decomposed to obtain the mode and eigenvalue. The initial time coefficient is determined according to the data of the first time point of the original data. The target time coefficient is determined according to the eigenvalue and the initial time coefficient. The original data is reconstructed by the mode and the target time coefficient to obtain the reconstructed data.
[0085] S305: for any time point, according to the multiple modes, the multiple eigenvalues, and the target time coefficient corresponding to each mode, determine the contribution value of the multiple modes to the evolution trend at the time point.
[0086] Exemplarily, the formula for calculating the contribution value may be:
[0087] d=c×(λ) 5
[0088] Among them, d represents the contribution value, c represents the target time coefficient, λ represents the eigenvalue, and k represents the index of the time point.
[0089] Combined with the scenario example, for any mode, for example, the target time coefficient is 0.816+0.016i, the eigenvalue is 1.02+0.02i, and the time point index is 5, that is, the contribution value of the mode at the 5th time point is calculated, and the calculated contribution value is d=(0.816+0.016i)×(1.02+0.02i) 5 .
[0090] Based on the above implementation methods, by determining the contribution values of multiple modes to the evolution trend at any time point according to multiple modes and the target time coefficient corresponding to each mode, the dynamic behavior of the original data can be deeply understood, thereby accurately predicting future trends.
[0091] S306: Determine a plurality of reconstructed data according to the contribution value corresponding to each historical time point.
[0092] Exemplarily, for any historical time point, the contribution value of each mode is summed to obtain the reconstructed data of the historical time point. The same process is performed on each historical time point to obtain multiple reconstructed data.
[0093] Next, combine Figure 5 The reconstruction process will be described.
[0094] Figure 5 This is a schematic diagram of the reconstruction process provided in the embodiment of the present application. Figure 5 As shown, for each historical time point 1, multiple contribution values corresponding to multiple modes at the historical time point are determined. For example, contribution value 1, contribution value 2, and contribution value 3 are contribution values of multiple modes at the historical time point 1. Contribution value 1, contribution value 2, and contribution value 3 are summed to obtain reconstructed data 1 of historical time point 1. The same is true for other historical time points.
[0095] In a feasible implementation method, the training method of the prediction model may also include: determining multiple intermediate data based on the contribution value corresponding to each historical time point; determining an error value based on the multiple intermediate data and the multiple original data; if the error value is less than the error threshold, determining the multiple data as multiple reconstructed data.
[0096] Optionally, the error value includes but is not limited to the following types: mean square error, root mean square error, or mean absolute error.
[0097] Optionally, the error threshold is determined based on the quality of the original data.
[0098] Combined with the scenario example, if the quality of the original data is poor, for example, there is a lot of invalid data, the error between the reconstructed data and the original data is large, and a larger error threshold is set.
[0099] Combined with the scenario example, the reconstructed data is obtained by reconstructing the original data. The reconstructed data is adjusted based on the original data, and there is a certain degree of similarity between the reconstructed data and the original data. If the error between the reconstructed data and the original data is large, it means that there may be problems in the reconstruction process, and it is necessary to further verify whether the reconstructed data is feasible.
[0100] In this feasible implementation, error verification can effectively improve the reliability of the reconstructed data and thus improve the accuracy of the prediction model.
[0101] S307: Train the preset model using multiple reconstructed data to obtain a target prediction model.
[0102] A feasible implementation method, the model training method may include: dividing multiple reconstructed data into a training set and a test set; determining training parameters; training the prediction model multiple times using the training parameters and the reconstructed data in the training set to obtain multiple intermediate models; backtesting the multiple intermediate models using the reconstructed data in the test set to obtain an intermediate loss function value corresponding to each intermediate model; until any intermediate loss function value is less than or equal to a loss function threshold, the corresponding intermediate model is determined as the target prediction model.
[0103] Optionally, the loss function value includes but is not limited to the following types: mean square error, root mean square error, or mean absolute error.
[0104] Optionally, the partitioning is performed by random partitioning or time series partitioning.
[0105] Among them, the backtest is to verify whether the difference between the output results of the intermediate model and the data in the test set is within the preset range.
[0106] Optionally, the training parameters include but are not limited to a learning rate, the number of trees, a maximum depth, or a minimum number of sample splits, etc.
[0107] In this feasible implementation, the loss function is used for verification, which can accurately verify whether the prediction model is qualified, thereby improving the accuracy of the target prediction model.
[0108] In a feasible implementation method, the model training method may also include: dividing a validation set from multiple reconstructed data; training the preset model multiple times using training parameters and the reconstructed data in the training set, and screening the reconstructed data in the validation set to obtain multiple intermediate models.
[0109] Combined with the scenario example, the model hyperparameters are tuned through the reconstructed data in the validation set.
[0110] Optionally, the validation set is determined by a cross-validation method. Specifically, the original data is divided into multiple folds, each fold is used as a validation set in turn, and the rest is used as a training set.
[0111] In this feasible implementation, by screening through the validation set, the generalization ability of the model can be evaluated, and the model can be prevented from overfitting on the training set, thereby improving the accuracy of model training.
[0112] In a feasible implementation method, the training of the prediction model also includes: determining multiple weights corresponding to multiple intermediate models according to the intermediate loss function value corresponding to each intermediate model; and fusing the multiple intermediate models according to the multiple weights to obtain the target prediction model.
[0113] For example, the target prediction model may be obtained by screening multiple intermediate models or by fusing multiple intermediate models.
[0114] Next, combine Figure 6 Explain model fusion.
[0115] Figure 6 This is a schematic diagram of the model fusion provided in the embodiment of the present application. Figure 6 As shown, the loss function value of each intermediate model is determined, the proportion of each loss function value in the sum of multiple loss function values is determined, the weight is determined according to the proportion, and the multiple intermediate models are weightedly fused according to the weight to obtain the target prediction model.
[0116] Optionally, the smaller the proportion of each loss function value in the sum of multiple loss function values, the greater the weight.
[0117] Combined with the scenario example, the smaller the loss function value, the better the effect of the intermediate model. Assigning a larger weight to it can improve the accuracy of the target fusion model obtained by fusion.
[0118] In this feasible implementation, the advantages of different models can be utilized through fusion processing, reducing the limitations of a single model, thereby improving the accuracy of the target prediction model.
[0119] Figure 7A schematic diagram of a training device for a prediction model provided in an embodiment of the present application. Figure 7 As shown, the prediction model training device 70 may include: a receiving module 71, a reconstruction module 72 and a training module 73, wherein:
[0120] The receiving module 71 is used to receive a training request, where the training request includes a plurality of original data corresponding to a plurality of historical time points of the target object.
[0121] The reconstruction module 72 is used to reconstruct the multiple original data through the dynamic mode decomposition method according to the training request to obtain multiple reconstructed data. The reconstruction process is used to extract the evolution characteristics of the multiple original data according to the evolution feature vectors of the multiple original data.
[0122] The training module 73 is used to train the preset model through multiple reconstructed data to obtain a target prediction model, and the target prediction model is used to predict the prediction result corresponding to the target object at a future time point.
[0123] Optionally, the receiving module 71 may execute Figure 2 S201 in the embodiment.
[0124] Optionally, the reconstruction module 72 may execute Figure 2 S202 in the embodiment.
[0125] Optionally, the training module 73 may execute Figure 2 S203 in the embodiment.
[0126] It should be noted that the training device of the prediction model shown in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0127] In a possible implementation, the reconstruction module 72 is specifically configured to:
[0128] By using a dynamic mode decomposition method, multiple modes and multiple eigenvalues corresponding to multiple original data are determined, wherein the multiple modes represent the evolutionary eigenvectors of the multiple original data at multiple historical time points, and the multiple eigenvalues represent the time evolution type corresponding to each mode;
[0129] Determine an initial time coefficient according to data at a first time point among the plurality of original data, wherein the initial time coefficient represents an initial state of evolution of the plurality of original data at the first time point;
[0130] For any mode, the product of the initial time coefficient and the corresponding eigenvalue is determined as the target time coefficient corresponding to the mode, and the target time coefficient represents the evolution trend of the corresponding mode;
[0131] Through multiple modes, multiple eigenvalues, and a target time coefficient corresponding to each mode, multiple original data are reconstructed to obtain multiple reconstructed data.
[0132] In a possible implementation, the reconstruction module 72 is specifically configured to:
[0133] For any historical time point, based on multiple modes, multiple eigenvalues, and the target time coefficient corresponding to each mode, determine the contribution value of multiple modes to the evolution trend at that time point;
[0134] According to the contribution value corresponding to each historical time point, multiple reconstructed data are determined.
[0135] Figure 8 A schematic diagram of the structure of a prediction model training device provided in an embodiment of the present application. Figure 7 Based on the embodiment shown, Figure 8 As shown, the prediction model training device 80 also includes: a judgment module 74, an execution module 75, and a fusion module 76, wherein:
[0136] The judging module 74 is used for:
[0137] Determine multiple intermediate data based on the contribution value corresponding to each historical time point;
[0138] Determine an error value based on the plurality of intermediate data and the plurality of original data;
[0139] If the error value is smaller than the error threshold, the plurality of data are determined as a plurality of reconstructed data.
[0140] The execution module 75 is used to:
[0141] Divide the multiple reconstructed data into training sets and test sets;
[0142] Determine training parameters;
[0143] The prediction model is trained multiple times using training parameters and reconstructed data in the training set to obtain multiple intermediate models;
[0144] Backtest multiple intermediate models using the reconstructed data in the test set to obtain the intermediate loss function value corresponding to each intermediate model;
[0145] Until any intermediate loss function value is less than or equal to the loss function threshold, the corresponding intermediate model is determined as the target prediction model.
[0146] In a possible implementation, the execution module 75 is specifically configured to:
[0147] Divide the validation set from multiple reconstruction data;
[0148] The prediction model is trained multiple times using training parameters and reconstructed data in the training set, and is screened using reconstructed data in the validation set to obtain multiple intermediate models.
[0149] The fusion module 76 is used to:
[0150] Determine multiple weights corresponding to multiple intermediate models according to the intermediate loss function value corresponding to each intermediate model;
[0151] According to multiple weights, multiple intermediate models are fused to obtain the target prediction model.
[0152] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Fig. 9 As shown, the electronic device includes:
[0153] The electronic device includes a processor 291 and a memory 292; it may also include a communication interface 293 and a bus 294. The processor 291, the memory 292, and the communication interface 293 may communicate with each other through the bus 294. The communication interface 293 may be used for information transmission. The processor 291 may call the logic instructions in the memory 292 to execute the method of the above embodiment.
[0154] In addition, the logic instructions in the above-mentioned memory 292 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.
[0155] The memory 292 is a computer-readable storage medium that can be used to store software programs and computer executable programs, such as program instructions / modules corresponding to the methods in the embodiments of the present application. The processor 291 executes functional applications and data processing by running the software programs, instructions, and modules stored in the memory 292, that is, implementing the methods in the above method embodiments.
[0156] The memory 292 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 292 may include a high-speed random access memory and may also include a non-volatile memory.
[0157] An embodiment of the present application provides a non-temporary computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the method as described in the above embodiment.
[0158] An embodiment of the present application provides a computer program product, including a computer program, which implements the method of the above embodiment when the computer program is executed by a processor.
[0159] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.
[0160] It should be further noted that, although the various steps in the flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0161] It should be understood that the above-mentioned device embodiments are only illustrative, and the device of the present application can also be implemented in other ways. For example, the division of units / modules in the above-mentioned embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.
[0162] In addition, unless otherwise specified, each functional unit / module in each embodiment of the present application may be integrated into one unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of a software program module.
[0163] If the integrated unit / module is implemented in the form of hardware, the hardware may be a digital circuit, an analog circuit, etc. The physical implementation of the hardware structure includes but is not limited to transistors, memristors, etc. The processor may be any appropriate hardware processor, such as a CPU, a GPU, an FPGA, a DSP, and an ASIC, etc. The storage unit may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc.
[0164] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0165] In the above embodiments, the description of each embodiment has its own emphasis. For the part not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0166] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0167] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A prediction model training method, characterized in that: include: receiving a training request, wherein the training request includes a plurality of original data corresponding to a plurality of historical time points of a target object; According to the training request, reconstructing the plurality of original data by a dynamic mode decomposition method to obtain a plurality of reconstructed data, wherein the reconstruction process is used to extract evolution features of the plurality of original data according to evolution feature vectors of the plurality of original data; The preset model is trained by using the multiple reconstructed data to obtain a target prediction model, and the target prediction model is used to predict the prediction result corresponding to the target object at a future time point.
2. The method according to claim 1, characterized in that The multiple original data are reconstructed by a dynamic mode decomposition method to obtain multiple reconstructed data, including: Determine, by a dynamic mode decomposition method, multiple modes and multiple eigenvalues corresponding to the multiple original data, wherein the multiple modes represent evolutionary eigenvectors of the multiple original data at multiple historical time points, and the multiple eigenvalues represent the time evolution type corresponding to each mode; Determine an initial time coefficient according to data at a first time point among the plurality of original data, wherein the initial time coefficient represents an initial state of evolution of the plurality of original data at the first time point; For any mode, the product of the initial time coefficient and the corresponding eigenvalue is determined as the target time coefficient corresponding to the mode, and the target time coefficient represents the evolution trend of the corresponding mode; The multiple original data are reconstructed using the multiple modes, the multiple eigenvalues, and the target time coefficient corresponding to each mode to obtain the multiple reconstructed data.
3. The method according to claim 2, characterized in that The multiple original data are reconstructed by using the multiple modes, the multiple eigenvalues, and the target time coefficient corresponding to each mode to obtain the multiple reconstructed data, including: For any historical time point, determining the contribution values of the multiple modes to the evolution trend at the time point according to the multiple modes, the multiple eigenvalues, and the target time coefficient corresponding to each mode; The plurality of reconstructed data are determined according to the contribution value corresponding to each historical time point.
4. The method according to claim 3, characterized in that The method further comprises: Determine multiple intermediate data based on the contribution value corresponding to each historical time point; Determine an error value according to the plurality of intermediate data and the plurality of original data; If the error value is smaller than an error threshold, the plurality of data are determined as the plurality of reconstructed data.
5. The method according to any one of claims 1 to 4, characterized in that The preset model is trained multiple times through the multiple reconstructed data to obtain a target prediction model, including: Dividing the plurality of reconstructed data into a training set and a test set; Determine training parameters; The preset model is trained multiple times using the training parameters and the reconstructed data in the training set to obtain multiple intermediate models; Backtest the multiple intermediate models respectively using the reconstructed data in the test set to obtain an intermediate loss function value corresponding to each intermediate model; Until any intermediate loss function value is less than or equal to the loss function threshold, the corresponding intermediate model is determined as the target prediction model.
6. The method according to claim 5, characterized in that The preset model is trained by using the training parameters and the reconstructed data in the training set to obtain the multiple intermediate models, including: Dividing a validation set from the plurality of reconstructed data; The preset model is trained multiple times using the training parameters and the reconstructed data in the training set, and the reconstructed data in the validation set is screened to obtain the multiple intermediate models.
7. The method according to claim 5 or 6, characterized in that: The method further comprises: Determining a plurality of weights corresponding to the plurality of intermediate models according to an intermediate loss function value corresponding to each intermediate model; According to the multiple weights, the multiple intermediate models are fused to obtain the target prediction model.
8. A prediction model training device, characterized in that: include: A receiving module, configured to receive a training request, wherein the training request includes a plurality of original data corresponding to a plurality of historical time points of a target object; A reconstruction module, configured to reconstruct the plurality of original data by a dynamic mode decomposition method according to the training request to obtain a plurality of reconstructed data, wherein the reconstruction process is configured to extract evolution features of the plurality of original data according to evolution feature vectors of the plurality of original data; The training module is used to train the preset model through the multiple reconstructed data to obtain a target prediction model, and the target prediction model is used to predict the prediction result corresponding to the target object at a future time point.
9. An electronic device, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.