Training method and device of time sequence prediction integrated model, electronic equipment and medium
By using random numbers and probability to determine the set and fusion weight of sub-models when training the integrated model, the training process is simplified, the cumbersome training problems in the existing technology are solved, and the training efficiency is improved.
Patent Information
- Application Number
- CN202410968219.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2024-11-05
AI Technical Summary
In the prior art, when training an integrated model, it is necessary to first train a single sub-model and then train the integrated model, which leads to a cumbersome training process.
The fusion of the output results of the sub-model is performed to simplify the training process of the ensemble model by determining the set of sub-models participating in training based on the random number and the selection probability, and determining the fusion weight of the output results based on the random number and the fusion probability.
It reduces the training complexity of the integrated model, simplifies the training process of the model, and improves the training efficiency.
Smart Images

Figure CN118897985A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a training method, device, electronic equipment and medium for a time series prediction integrated model. Background Art
[0002] Time series forecasting is based on time series data (i.e. data points arranged in chronological order) and uses statistical and machine learning techniques to predict future values, such as Figure 1 FIG. 1 is a schematic diagram of the principle of time series prediction provided by the present invention. Time series prediction is widely used in many fields such as traffic flow, finance, energy, weather and sales to assist decision-making and planning.
[0003] An integrated model is one that is composed of multiple sub-models that are integrated to obtain more accurate prediction results by combining the advantages and learning features of different models. It has better generalization ability, robustness and performance.
[0004] In the prior art, when training an integrated model, it is necessary to first train each sub-model and then train the integrated model. This results in the need to train the integrated model in two stages, and the training process is relatively cumbersome. Summary of the invention
[0005] The present invention provides a training method, device, electronic device and medium for a time series prediction integrated model, which are used to solve the problem in the prior art that when training an integrated model, it is necessary to first train a single sub-model and then train the integrated model, resulting in a more complicated training process of the integrated model.
[0006] In a first aspect, the present invention provides a training method for a time series prediction integrated model, comprising: determining a set of sub-models participating in training from the integrated model based on a first random number and a selection probability; inputting sample time series data into each sub-model of the sub-model set to obtain an output result of each sub-model; determining a fusion weight of the output result of each sub-model based on a second random number and a fusion probability; fusing the output results of each sub-model based on the fusion weight to obtain a fusion result, and using the fusion result as the output result of the integrated model for the sample time series data for training the integrated model.
[0007] Optionally, a set of sub-models participating in training is determined from the integrated model based on a first random number and a selection probability, including: generating a first random number, and determining a relationship between the first random number and the selection probability; when the first random number is less than or equal to the selection probability, determining all sub-models in the integrated model as a set of sub-models; when the first random number is greater than the selection probability, determining a set of sub-models participating in training from the integrated model based on a sampling probability of each sub-model in the integrated model.
[0008] Optionally, when the first random number is greater than the selection probability, based on the sampling probability of each sub-model in the integrated model, a set of sub-models participating in training is determined from the integrated model, including: generating a third random number for any target sub-model in the integrated model; determining the relationship between the third random number of the target sub-model and the sampling probability of the target sub-model; and based on the relationship, determining the sub-model whose third random number is greater than or equal to the sampling probability as the sub-model set.
[0009] Optionally, the fusion weight of the output result of each sub-model is determined based on the second random number and the fusion probability, including: generating a second random number, and determining the relationship between the second random number and the fusion probability; when the second random number is less than or equal to the fusion probability, determining that the fusion weights of each sub-model are equal; when the second random number is greater than the fusion probability, determining the fusion weight of each sub-model by the score of each sub-model.
[0010] Optionally, when the second random number is greater than the fusion probability, the fusion weight of the output results of each sub-model is determined by the score of each sub-model, including: normalizing the score of each sub-model and using the normalized value as the fusion weight of each sub-model.
[0011] In the second aspect, the present invention provides a training device for a time series prediction integrated model, comprising: a first determination module, used to determine a set of sub-models participating in training from the integrated model based on a first random number and a selection probability; a processing module, used to input sample time series data into each sub-model of the sub-model set to obtain an output result of each sub-model; a second determination module, used to determine a fusion weight of the output result of each sub-model based on a second random number and a fusion probability; a fusion module, used to fuse the output results of each sub-model based on the fusion weight to obtain a fusion result, and the fusion result is used as the output result of the integrated model for the sample time series data for the training of the integrated model.
[0012] The first determination module in the training device of the time series prediction integrated model provided by the present invention is specifically used to: generate a first random number and determine the size relationship between the first random number and the selection probability; when the first random number is less than or equal to the selection probability, all sub-models in the integrated model are determined as a sub-model set; when the first random number is greater than the selection probability, based on the sampling probability of each sub-model in the integrated model, determine the sub-model set participating in the training from the integrated model.
[0013] In a third aspect, the present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a training method for a time series prediction integrated model as described above is implemented.
[0014] In a fourth aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a training method for any of the above-mentioned time series prediction integrated models.
[0015] In a fifth aspect, the present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements a training method for any of the above-mentioned time series prediction integrated models.
[0016] The training method of the time series prediction integrated model provided by the present invention determines the sub-model set participating in the training from the integrated model through the first random number and the selection probability; then the sample time series data is input into each sub-model of the sub-model set to obtain the output result of each sub-model, and the fusion weight of the output result is determined through the second random number and the fusion probability; the output results of each sub-model are fused based on the fusion weight to obtain the fusion result, and the fusion result is used as the output result of the integrated model for the sample time series data to train the integrated model. By selecting the sub-models to be trained by the random number and probability to be involved, the training complexity of the integrated model is reduced. Compared with the traditional training of the integrated model, the training process of the model is simplified. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 It is a schematic diagram of the principle of time series prediction provided by the present invention.
[0019] Figure 2 It is a flow chart of the training method of the time series prediction integrated model provided by the present invention.
[0020] Figure 3 It is a schematic diagram of the training process of the integrated model provided by the present invention.
[0021] Figure 4 It is a schematic diagram of the process of model sampling provided by the present invention.
[0022] Figure 5 It is a structural schematic diagram of a training device for a time series prediction integrated model provided by the present invention.
[0023] Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0025] It should be noted that, in the embodiments of the present invention, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0026] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the method and device in the embodiment of the present invention is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0027] In order to clearly describe the technical solutions of the embodiments of the present invention, in the embodiments of the present invention, the words "first", "second", etc. are used to distinguish between the same items or similar items with basically the same functions and effects. Those skilled in the art can understand that the words "first", "second", etc. are not limiting the quantity and execution order.
[0028] Figure 2 FIG. 1 is a flow chart of the training method of the time series prediction integrated model provided by the present invention. Figure 2 As shown, the method includes the following steps S202-S208: Step S202: Determine a set of sub-models participating in training from the integrated model based on the first random number and the selection probability.
[0029] As an optional embodiment, an integrated model refers to a model that is composed of multiple sub-models through integration. The integrated model in the embodiment of the present application is used to predict time series data. The number of sub-models in the integrated model can be flexibly set according to actual needs. The embodiment of the present application does not further limit this.
[0030] In an exemplary embodiment, the above step S202 can be implemented by the following steps S11-13: Step S11: Generate a first random number, and determine the relationship between the first random number and the selection probability.
[0031] As an optional embodiment, the first random number is a real number between 0 and 1. The first random number can also be set to a real number with a larger value. However, compared with the real number between 0 and 1, a larger value requires more complicated steps in the processing process. Since only the first random number and the selection probability need to be compared in size here, there is no need to select a too large number, and it is usually set to 0.5.
[0032] Step S12: When the first random number is less than or equal to the selection probability, all sub-models in the integrated model are determined as a sub-model set.
[0033] As an optional embodiment, assuming that the first random number is 0.3 and the selection probability is 0.5, the size of the first random number is smaller than the selection probability. In this case, assuming that the integrated model contains 5 sub-models, namely: sub-model 1, sub-model 2, sub-model 3, sub-model 4 and sub-model 5. At this time, all sub-models are determined as a sub-model set, that is, the current sub-model set includes: sub-model 1, sub-model 2, sub-model 3, sub-model 4 and sub-model 5.
[0034] Step S13: When the first random number is greater than the selection probability, a set of sub-models participating in training is determined from the integrated model based on the sampling probability of each sub-model in the integrated model.
[0035] As an optional embodiment, assume that the integrated model contains 5 sub-models, namely: sub-model 1, sub-model 2, sub-model 3, sub-model 4 and sub-model 5, the first random number is 0.7, and the selection probability is 0.5. At this time, the first random number is greater than the selection probability, and some are selected from these five sub-models as the sub-model set.
[0036] As an optional embodiment, the selection probability can be flexibly set. In order to simplify the process, it is usually set to a real number between 0 and 0.5.
[0037] In an exemplary embodiment, the above step S13 can be implemented by the following steps S131-S133: Step S131: For any target sub-model in the integrated model, generate a third random number.
[0038] As an optional embodiment, assume that the integrated model includes 5 sub-models, namely: sub-model 1, sub-model 2, sub-model 3, sub-model 4 and sub-model 5. Generate a third random number for each sub-model. For example, the random number corresponding to sub-model 1 is 0.7, the random number corresponding to sub-model 2 is 0.4, the random number corresponding to sub-model 3 is 0.6, the random number corresponding to sub-model 4 is 0.5 and the random number corresponding to sub-model 5 is 0.9.
[0039] Step S132: Determine the relationship between the third random number of the target sub-model and the sampling probability of the target sub-model.
[0040] As an optional embodiment, the sampling probability of the sub-model can also be flexibly set. The sampling probability of each sub-model can be equal or unequal. Here, taking equal sampling probability as an example, assuming that the sampling probability of the five sub-models is 0.5, the size relationship between 0.5 and its corresponding random number is compared respectively.
[0041] Step S133: Based on the size relationship, the sub-models whose third random numbers are greater than or equal to the sampling probability are determined as the sub-model set.
[0042] As an optional embodiment, assuming that the random number corresponding to sub-model 1 is 0.7, the random number corresponding to sub-model 2 is 0.4, the random number corresponding to sub-model 3 is 0.6, the random number corresponding to sub-model 4 is 0.5 and the random number corresponding to sub-model 5 is 0.9, the random numbers of sub-model 1-sub-model 5 are all 0.5, and after comparing the size relationships, the sub-model set is: sub-model 1, sub-model 3, sub-model 4 and sub-model 5.
[0043] It should be noted that each time, at least one sub-model must be selected. If no sub-model is selected, resampling is required. At the same time, in order to ensure that at least one sub-model is selected, the sampling probability is usually set to a relatively small value.
[0044] Step S204: input the sample time series data into each sub-model of the sub-model set to obtain the output result of each sub-model.
[0045] As an optional embodiment, the sample time series data in the above step S204 may be obtained by enhancing the original time series data through data enhancement technology. Specifically, a training sample data is recorded as ,in is a multi-dimensional input time series vector, is the true result of the prediction window, and the enhanced time series data is obtained , for The enhanced results, for The result after enhancement. The purpose of data enhancement is to increase the amount of sample time series data. By inputting sample data into the sub-model, the sub-model can be tuned during ensemble training.
[0046] Step S206: Determine the fusion weight of the output results of each sub-model based on the second random number and the fusion probability.
[0047] In an exemplary embodiment, the above step S206 can be implemented by the following steps S21-S23: Step S21: Generate a second random number, and determine the relationship between the second random number and the fusion probability.
[0048] As an optional embodiment, the generation range of the second random number can be set to a real number between 0 and 1, and the fusion probability can be flexibly set according to demand. In order to simplify the process, it can be set to a real number between 0 and 0.5.
[0049] Step S22: when the second random number is less than or equal to the fusion probability, determine that the fusion weights of the sub-models are equal.
[0050] As an optional embodiment, assume that the second random number is 0.3 and the fusion probability is 0.5. At this time, the second random number is less than the fusion probability, then the fusion probability of each sub-model is equal, that is, the output results of each sub-model are fused with equal weights to obtain the fusion result. For example, the output result of sub-model 1 is 2, the output result of sub-model 3 is 5, the output result of sub-model 4 is 1, and the output result of sub-model 5 is 6. At this time, the fusion weights of these four sub-models are all 0.25, and the fusion result is 3.5.
[0051] Step S23: When the second random number is greater than the fusion probability, the fusion weight of each sub-model is determined by the score of each sub-model.
[0052] As an optional embodiment, assume that the second random number is 0.7 and the fusion probability is 0.5. In this case, if the second random number is greater than the fusion probability, the fusion weight needs to be determined through model scoring.
[0053] As an optional embodiment, the scoring model is used to evaluate the score of each sub-model. The score of each model can be directly obtained through the scoring model. At the same time, the scoring model can be integrated into the integrated model to better determine the score of each sub-model.
[0054] In an exemplary embodiment, the above step S23 can be implemented by the following steps S231: Step S231: Normalize the scores of each sub-model, and use the normalized values as the fusion weights of each sub-model.
[0055] As an optional embodiment, the scores of the sub-models in the integrated model can be normalized by using the Softmax function.
[0056] Step S208: The output results of each sub-model are fused based on the fusion weight to obtain a fusion result, and the fusion result is used as the output result of the integrated model for the sample time series data for training the integrated model.
[0057] In the above steps S202-S208, the sub-model set participating in the training is determined from the integrated model by the first random number and the selection probability; then the sample time series data is input into each sub-model of the sub-model set to obtain the output result of each sub-model, and the fusion weight of the output result is determined by the second random number and the fusion probability; the output results of each sub-model are fused based on the fusion weight to obtain the fusion result, and the fusion result is used as the output result of the integrated model for the sample time series data to train the integrated model. By selecting the sub-models to be trained by the random number and probability, the training complexity of the integrated model is reduced. Compared with the traditional training of the integrated model, the training process of the model is simplified.
[0058] The main body of each execution step in the method can be a training device for the time series prediction integrated model, which can be implemented by software and / or hardware. The device can be integrated in an electronic device, which can be a terminal device (such as a smart phone, a personal computer, etc.), a server (such as a local server or a cloud server, or a server cluster, etc.), a processor, a chip, etc.
[0059] Obviously, the above-described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. In order to better understand the above method, the above process is described below in conjunction with the embodiments, but the technical solutions of the embodiments of the present invention are not limited. Specifically: Figure 3 Schematic diagram of the training process of the integrated model provided by the present invention. Figure 3 As shown, the main steps of the training process are: 1. Data Augmentation
[0060] Use data enhancement technology to enhance the original time series data. Let a training sample data be ,in is a multi-dimensional input time series vector, is the true result of the prediction window, and the enhanced time series data is obtained ,in, for The enhanced results, for The result after enhancement. The purpose of data enhancement is to increase the amount of training data. In addition, it should be noted that the integrated model is composed of multiple sub-models, and its parameter quantity is the sum of the parameter quantities of all sub-models.
[0061] 2. Sampling strategy
[0062] The integrated model consists of multiple sub-models and a scoring model. Each sub-model inputs time series data and outputs the corresponding prediction results. can be expressed as:
[0063] It should be noted that in the above formula, For sub-model The output prediction results are: Represents a prediction model.
[0064] The scoring model is used to evaluate the scores of each sub-model. The goal is to give higher scores to models with more accurate predictions to increase their weight in the result fusion. The scoring model can be expressed as:
[0065] It should be noted that in the above formula, To evaluate the model, The rating given, Represents a scoring model.
[0066] Specifically, when training the integrated model, the present invention uses a sampling strategy to determine the model set participating in this training during each batch of training. The specific sampling strategy is to randomly sample all N sub-models with a sampling probability, and the sampling probability of each model can be the same or different. The purpose of sampling is to allow the integrated model to train each sub-model to make good predictions and to allow them to cooperate with each other to achieve better results in the integration.
[0067] It should be noted that during the sampling process, it is necessary to ensure that at least one model is selected each time, and the sampling process is repeated when no model is selected. All models are enabled (corresponding to the selection probability in the above embodiment) in order to be closer to the situation during inference. Figure 4 is a schematic diagram of the flow chart of the model sampling provided by the present invention, according to Figure 4 The process shown obtains a model set S (corresponding to the sub-model set in the above embodiment).
[0068] 3. Result Fusion
[0069] The results of multiple sub-models in the model set S are integrated to obtain the prediction results of the integrated model. The model fusion method is: (Corresponding to the fusion probability in the above embodiment) Enable the pooling mode, that is, each sub-model takes an equal weight value, so that each sub-model is trained more evenly. Otherwise, use the Softmax function to normalize the scores of the sub-models in the model set S to obtain the weights of each sub-model, and calculate the results of each sub-model according to the corresponding weight values to obtain the prediction results of the integrated model.
[0070]
[0071] It should be noted that in the above formula It is The weight of each sub-model, For the The prediction results of each sub-model are Represents a collection of submodels.
[0072] 4. Loss calculation and model update
[0073] like Figure 3 As shown in , the input and output of the entire integrated model are consistent with the sub-models, and the internal modules are all differentiable, so the gradient descent method can be sampled for one-stage training. Loss calculation and model update are general steps for machine learning model training.
[0074] In short, the integrated model training method provided by the present invention simplifies the training process and reduces the complexity of using the integrated model. In addition, the present invention uses data enhancement to increase training data and dynamically samples the model, further improving the accuracy of model prediction.
[0075] Taking the load data disclosed by the power market of a certain province as an example, the prediction results are shown in the following table. Evaluation indicators are given for four predictions of different lengths. It can be seen that the scheme in the present invention is superior or equivalent to sub-models 1-4 in most cases: Table 1: Prediction results of power market load data
[0076] It should be noted that the values of the two evaluation indicators in each column are: RMSE (mean square error) and MAE (mean absolute error). The smaller the value, the better. It can be seen that compared with models 1-4, the integrated model provided by the present invention has the best prediction effect for time series data. Models 1-4 are the indicators of the corresponding self-models under the same configuration.
[0077] In addition, the following Table 2 shows the effect of predicting the power generation of photovoltaic stations, predicting the power generation efficiency every 15 minutes of the next day. The evaluation indicators are MAP (average precision, 100% absolute error at each point / true value at the point, the higher the average precision, the better), RMSE (mean square error), and MAE (mean absolute error).
[0078] Table 2: Prediction results of photovoltaic power generation
[0079] The training device for the time series prediction integrated model provided by the present invention is described below. The training device for the time series prediction integrated model described below and the training method for the time series prediction integrated model described above can refer to each other.
[0080] Figure 5 Schematic diagram of the structure of the training device of the time series prediction integrated model provided by the present invention. Figure 5 As shown, the device comprises: The first determination module 502 is used to determine a set of sub-models participating in training from the integrated model based on a first random number and a selection probability.
[0081] The processing module 504 is used to input the sample time series data into each sub-model of the sub-model set to obtain the output result of each sub-model.
[0082] The second determination module 506 is used to determine the fusion weight of the output results of each sub-model based on the second random number and the fusion probability.
[0083] The fusion module 508 is used to fuse the output results of each sub-model based on the fusion weight to obtain a fusion result. The fusion result is used as the output result of the integrated model for the sample time series data for the training of the integrated model.
[0084] Through the training device of the above-mentioned time series prediction integrated model, the sub-model set participating in the training is determined from the integrated model by the first random number and the selection probability; then the sample time series data is input into each sub-model of the sub-model set to obtain the output result of each sub-model, and the fusion weight of the output result is determined by the second random number and the fusion probability; based on the fusion weight, the output results of each sub-model are fused to obtain the fusion result, and the fusion result is used as the output result of the integrated model for the sample time series data to train the integrated model. By selecting the sub-model to be trained by the random number and probability, the training complexity of the integrated model is reduced. Compared with the traditional training of the integrated model, the training process of the model is simplified.
[0085] Optionally, the first determination module 502 is specifically used to generate a first random number and determine the relationship between the first random number and the selection probability; when the first random number is less than or equal to the selection probability, all sub-models in the integrated model are determined as a sub-model set; when the first random number is greater than the selection probability, based on the sampling probability of each sub-model in the integrated model, the sub-model set participating in the training is determined from the integrated model.
[0086] Optionally, the first determination module 502 is also used to generate a first random number and determine the relationship between the first random number and the selection probability; when the first random number is less than or equal to the selection probability, all sub-models in the integrated model are determined as a sub-model set; when the first random number is greater than the selection probability, based on the sampling probability of each sub-model in the integrated model, the sub-model set participating in the training is determined from the integrated model.
[0087] Optionally, the first determination module 502 is also used to generate a third random number for any target sub-model in the integrated model; determine the relationship between the third random number of the target sub-model and the sampling probability of the target sub-model; and based on the relationship, determine the sub-model whose third random number is greater than or equal to the sampling probability as a sub-model set.
[0088] Optionally, the second determination module 506 is also used to generate a second random number and determine the relationship between the second random number and the fusion probability; when the second random number is less than or equal to the fusion probability, the fusion weights of each sub-model are determined to be equal; when the second random number is greater than the fusion probability, the fusion weights of each sub-model are determined by the score of each sub-model.
[0089] Optionally, the second determination module 506 is further used to normalize the scores of each sub-model and use the normalized values as the fusion weights of each sub-model.
[0090] Figure 6 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 6 As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communication interface 620, and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute the training method of the time series prediction integrated model, and the method includes: A set of sub-models participating in training is determined from the integrated model based on the first random number and the selection probability.
[0091] The sample time series data is input into each sub-model of the sub-model set to obtain the output result of each sub-model.
[0092] The fusion weight of the output results of each sub-model is determined based on the second random number and the fusion probability.
[0093] The output results of each sub-model are fused based on the fusion weight to obtain a fusion result, and the fusion result is used as the output result of the integrated model for the sample time series data for the training of the integrated model.
[0094] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of 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 methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0095] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the training method of the time series prediction integrated model provided by the above methods, the method includes: A set of sub-models participating in training is determined from the integrated model based on the first random number and the selection probability.
[0096] The sample time series data is input into each sub-model of the sub-model set to obtain the output result of each sub-model.
[0097] The fusion weight of the output results of each sub-model is determined based on the second random number and the fusion probability.
[0098] The output results of each sub-model are fused based on the fusion weight to obtain a fusion result, and the fusion result is used as the output result of the integrated model for the sample time series data for the training of the integrated model.
[0099] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute the training method of the time series prediction integrated model provided by the above methods, the method comprising: A set of sub-models participating in training is determined from the integrated model based on the first random number and the selection probability.
[0100] The sample time series data is input into each sub-model of the sub-model set to obtain the output result of each sub-model.
[0101] The fusion weight of the output results of each sub-model is determined based on the second random number and the fusion probability.
[0102] The output results of each sub-model are fused based on the fusion weight to obtain a fusion result, and the fusion result is used as the output result of the integrated model for the sample time series data for the training of the integrated model.
[0103] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.
[0104] Through the description of the above implementation modes, those skilled in the art can clearly understand that each implementation mode can be implemented by means of software plus a necessary general hardware platform, or of course by hardware. Based on such an understanding, the above technical solution can essentially or in other words be embodied in the form of a software product that contributes to the prior art. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.
[0105] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A training method for a time series prediction ensemble model, characterized in that: include: Determine a set of sub-models participating in training from the integrated model based on the first random number and the selection probability; Inputting sample time series data into each sub-model of the sub-model set to obtain output results of each sub-model; Determine the fusion weight of the output results of each sub-model based on the second random number and the fusion probability; The output results of the sub-models are fused based on the fusion weight to obtain a fusion result, and the fusion result is used as the output result of the integrated model for the sample time series data for training the integrated model.
2. The training method of the time series prediction integrated model according to claim 1, characterized in that: The step of determining a set of sub-models to be trained from the integrated model based on the first random number and the selection probability includes: Generate the first random number, and determine the relationship between the first random number and the selection probability; In a case where the first random number is less than or equal to the selection probability, all sub-models in the integrated model are determined as the sub-model set; When the first random number is greater than the selection probability, a set of sub-models participating in training is determined from the integrated model based on the sampling probability of each sub-model in the integrated model.
3. The training method of the time series prediction integrated model according to claim 2, characterized in that: The step of determining a set of sub-models to be trained from the integrated model based on the sampling probability of each sub-model in the integrated model when the first random number is greater than the selection probability includes: For any target sub-model in the integrated model, generating a third random number; Determine a magnitude relationship between a third random number of the target sub-model and a sampling probability of the target sub-model; Based on the size relationship, the sub-models whose third random numbers are greater than or equal to the sampling probability are determined as the sub-model set.
4. The training method of the time series prediction integrated model according to claim 1, characterized in that: The determining the fusion weight of the output results of each sub-model based on the second random number and the fusion probability includes: Generate the second random number, and determine the magnitude relationship between the second random number and the fusion probability; When the second random number is less than or equal to the fusion probability, determining that the fusion weights of the sub-models are equal; When the second random number is greater than the fusion probability, the fusion weight of each sub-model is determined by the score of each sub-model.
5. The training method of the time series prediction integrated model according to claim 4 is characterized in that: The step of determining the fusion weight of the output results of each sub-model by the score of each sub-model when the second random number is greater than the fusion probability includes: The scores of the sub-models are normalized, and the normalized values are used as the fusion weights of the sub-models.
6. A training device for a time series prediction integrated model, characterized in that: include: A first determination module, used to determine a sub-model set participating in training from the integrated model based on a first random number and a selection probability; A processing module, used for inputting sample time series data into each sub-model of the sub-model set to obtain output results of each sub-model; A second determination module, used to determine the fusion weight of the output results of each sub-model based on the second random number and the fusion probability; A fusion module is used to fuse the output results of each sub-model based on the fusion weight to obtain a fusion result, and the fusion result is used as the output result of the integrated model for the sample time series data for training the integrated model.
7. The training device for the time series prediction integrated model according to claim 6, characterized in that: The first determining module is specifically configured to: Generate the first random number, and determine the relationship between the first random number and the selection probability; In a case where the first random number is less than or equal to the selection probability, all sub-models in the integrated model are determined as the sub-model set; When the first random number is greater than the selection probability, a set of sub-models participating in training is determined from the integrated model based on the sampling probability of each sub-model in the integrated model.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, it implements the training method of the time series prediction integrated model as described in any one of claims 1 to 5.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the training method of the time series prediction integrated model as described in any one of claims 1 to 5.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, it implements the training method of the time series prediction integrated model as described in any one of claims 1 to 5.
