Method and device for determining target traffic prediction model, and storage medium
Through multiple rounds of screening and cross-operation optimization of hyperparameter sets, the problem of poor performance of traffic prediction models in the existing technology is solved, and higher prediction accuracy and model performance improvement are achieved.
Patent Information
- Application Number
- CN202411271029.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2024-12-06
AI Technical Summary
The existing flow prediction model relies on manual adjustment during hyperparameter adjustment, resulting in poor model performance, low prediction result accuracy, and limited types of hyperparameter sets. It is not possible to make full use of multiple rounds of screening and cross-operations to improve model performance.
Multiple rounds of screening and cross-operation methods are used to cross-operate multiple hyperparameter sets, and the cross-over probability is determined based on the comparison results of model errors, and the hyperparameter set is gradually optimized until a target flow prediction model with better performance is obtained.
Through multiple rounds of screening and cross-operation, the performance of the candidate flow prediction model is significantly improved, and higher prediction accuracy and better model parameters are obtained, solving the problems of low efficiency and poor performance of hyperparameter adjustment in the existing technology.
Smart Images

Figure CN119094373A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device and storage medium for determining a target traffic prediction model. Background Art
[0002] With the continuous development of deep learning technology, applying the trained models to different application scenarios can better facilitate people's lives. For example, in a transportation service platform, the actual exposure information of the source of goods online on the transportation service platform in the first time period is used as the input of the model, and the exposure results of the source of goods online on the transportation service platform in the second time period after the first time period are used as the expected output of the model to train the model. In this way, a traffic prediction model that can predict the exposure of sources of goods in future time periods can be obtained. This traffic prediction model can better manage the traffic of the source of goods that will be online on the transportation platform in the future, thereby meeting the user's usage needs.
[0003] At present, when training a traffic prediction model, the hyperparameters in the traffic prediction model are generally trained to obtain different traffic prediction models by manually adjusting the hyperparameters. For example, for the initial traffic prediction model to be trained, multiple hyperparameter sets are manually set, and the candidate traffic prediction model corresponding to each hyperparameter set is obtained by training the initial traffic prediction model corresponding to the hyperparameter set. Then, the target traffic prediction model that meets the performance requirements is selected from the candidate traffic prediction models for use.
[0004] However, the performance of the target flow prediction model determined in the above manner is poor, resulting in low accuracy of the prediction result. Summary of the invention
[0005] The present application provides a method, device and storage medium for determining a target traffic prediction model, wherein multiple rounds of screening and crossover operations are performed on multiple hyperparameter sets, wherein the multiple hyperparameter sets include multiple first hyperparameter sets and multiple second hyperparameter sets, and for each first hyperparameter set and the corresponding second hyperparameter set, the crossover probability based on whether to perform the crossover operation is determined based on the minimum error in the model errors corresponding to the multiple first candidate hyperparameter sets, and the comparison result of the minimum error in the model errors corresponding to the current first hyperparameter set and the second hyperparameter set. In this way, it is helpful to improve the performance of the candidate traffic prediction models corresponding to the first hyperparameter set and the second hyperparameter set, thereby helping to obtain a target traffic prediction model with better performance.
[0006] In a first aspect, the present application provides a method for determining a target traffic prediction model, comprising: determining multiple first candidate hyperparameter sets from multiple preset hyperparameter sets; wherein, after the initial traffic prediction model corresponding to the first candidate hyperparameter set is trained, the model error of the first candidate traffic prediction model obtained satisfies a first preset condition; the number of hyperparameters in each of the first candidate hyperparameter sets is the same; the multiple first candidate hyperparameter sets include multiple first hyperparameter sets and multiple second hyperparameter sets, and the multiple first hyperparameter sets and the multiple second hyperparameter sets correspond one to one; for each first hyperparameter set and the corresponding second hyperparameter set in the multiple first candidate hyperparameter sets, the first hyperparameter sets are respectively determined. At least one first target hyperparameter in a hyperparameter set and at least one second target hyperparameter in the second hyperparameter set, when the randomly generated first value is less than the crossover probability, the at least one first target hyperparameter in the first hyperparameter set and the at least one second target hyperparameter in the second hyperparameter set are exchanged to obtain multiple second candidate hyperparameter sets; wherein the crossover probability is determined based on the first minimum error in the model errors corresponding to the multiple first candidate hyperparameter sets, and the comparison result of the model error corresponding to the first hyperparameter set and the second minimum error in the model error corresponding to the second hyperparameter set; for each of the second candidate hyperparameter sets, the first time The exposure information of the source of goods online in the first time period is input into the initial traffic prediction model corresponding to the second candidate hyperparameter set, and the initial traffic prediction model corresponding to the second candidate hyperparameter set is iteratively trained based on the exposure result of the source of goods online in the second time period until the iteration stop condition is met, so as to obtain the second candidate traffic prediction model corresponding to the second candidate hyperparameter set; wherein, the first time period is before the second time period; based on the prediction result of the second candidate traffic prediction model for the exposure information of the source of goods online in the first time period and the exposure result, the model error of the second candidate traffic prediction model corresponding to the second candidate hyperparameter set is obtained; among the multiple second candidate hyperparameter sets, In the case where there is a second candidate hyperparameter set whose model error is greater than the first preset threshold, or the number of times the first candidate hyperparameter set is updated is less than the second preset threshold, for the multiple second candidate hyperparameter sets, return to execute the operation of determining multiple first candidate hyperparameter sets from the multiple second candidate hyperparameter sets and updating the multiple first candidate hyperparameter sets until the model errors corresponding to the updated multiple second candidate hyperparameter sets are all less than or equal to the first preset threshold, and the number of times the multiple first candidate hyperparameter sets are updated is greater than or equal to the second preset threshold; determine the second candidate traffic prediction model with the smallest model error among the current multiple second candidate hyperparameter sets as the target traffic prediction model;The target traffic prediction model is used to predict the exposure results of the source of goods that will be launched in the future time period based on the exposure information of the source of goods that were launched in the historical time period obtained by statistics. ;
[0007] In some embodiments, the crossover probability is determined based on the first minimum error and the second minimum error by using Formula 1 or Formula 2.
[0008] In some embodiments, after obtaining the model error of the second candidate traffic prediction model corresponding to the second candidate hyperparameter set, the method further includes: determining a plurality of third candidate hyperparameter sets whose model errors satisfy a second preset condition among the plurality of second candidate hyperparameter sets; for each third candidate hyperparameter set, determining at least one third target hyperparameter in the third candidate hyperparameter set, and based on the randomly generated second value being less than the mutation probability, changing at least one third target hyperparameter in the third candidate hyperparameter set to obtain a plurality of fourth candidate hyperparameter sets; wherein the mutation probability is determined based on the third minimum error among the model errors corresponding to the plurality of third candidate hyperparameter sets, and the model error corresponding to the current third candidate hyperparameter set; for each fourth candidate hyperparameter set among the plurality of fourth candidate hyperparameter sets, inputting the exposure information of the source of goods online in the first time period into the initial traffic prediction model corresponding to the fourth candidate hyperparameter set, iteratively training the initial traffic prediction model based on the exposure result of the source of goods online in the second time period until the iteration stop condition is met, and obtaining the fourth candidate traffic prediction model corresponding to the fourth candidate hyperparameter set; based on the plurality of fourth candidate hyperparameter sets, A traffic prediction model is selected to respectively predict the exposure results of the source of goods that are online in the second time period and the actual exposure results of the source of goods that are online in the second time period, and obtain the model errors corresponding to the multiple fourth candidate hyperparameter sets respectively; a perturbation operation is performed on the multiple fourth candidate hyperparameter sets to obtain multiple fifth candidate hyperparameter sets; among the multiple fifth candidate hyperparameter sets, if there is a fifth candidate hyperparameter set whose model error is greater than the third preset threshold, or the number of times the fifth candidate hyperparameter set is updated is less than the second preset threshold, for the multiple fifth candidate hyperparameter sets, return to execute the operations of determining multiple first candidate hyperparameter sets from the multiple fifth candidate hyperparameter sets, updating multiple first candidate hyperparameter sets, updating multiple third candidate hyperparameter sets, and performing perturbation operations on multiple fourth candidate hyperparameter sets, until the model errors corresponding to the updated multiple fifth candidate hyperparameter sets are all less than or equal to the third preset threshold, and the number of times the multiple fifth candidate hyperparameter sets are updated is greater than or equal to the second preset threshold; the fifth candidate traffic prediction model with the smallest model error among the current multiple fifth candidate hyperparameter sets is determined as the target traffic prediction model.
[0009] In some embodiments, based on the third minimum error and the model error corresponding to the third candidate hyperparameter set, the mutation probability corresponding to the third candidate hyperparameter set is determined by Formula 3 or Formula 4.
[0010] In some embodiments, the perturbation operation is performed on multiple fourth candidate hyperparameter sets to obtain multiple fifth candidate hyperparameter sets, including: for each fourth candidate hyperparameter set, based on formula five, perturb the hyperparameters in the fourth candidate hyperparameter set to obtain the corresponding sixth candidate hyperparameter set; for each sixth candidate hyperparameter set, determine the model error corresponding to the sixth candidate hyperparameter set, if the model error of the sixth candidate hyperparameter set is less than the model error corresponding to the corresponding fourth candidate hyperparameter set, determine the sixth candidate hyperparameter set as the fifth candidate hyperparameter set; if the model error of the sixth candidate hyperparameter set is greater than the model error corresponding to the corresponding fourth candidate hyperparameter set, when the randomly generated third numerical value is less than the perturbation probability, determine the sixth candidate hyperparameter set as the fifth candidate hyperparameter set; when the third numerical value is greater than or equal to the perturbation probability, determine the corresponding fourth candidate hyperparameter set as the fifth candidate hyperparameter set.
[0011] In some embodiments, the perturbation probability is determined by formula six based on the error model corresponding to the sixth candidate hyperparameter set, the model error corresponding to the fourth candidate hyperparameter set, and the number of times the fifth candidate hyperparameter set is currently updated.
[0012] In some embodiments, the determining of multiple first candidate hyperparameter sets from a plurality of preset hyperparameter sets includes: sorting the multiple hyperparameter sets in order of model error from small to large, and selecting the multiple first candidate hyperparameter sets with top rankings from the multiple candidate hyperparameter sets according to a preset ratio; or, looping the following operation multiple times to obtain multiple first candidate hyperparameter sets: randomly selecting N sixth candidate hyperparameter sets from the multiple hyperparameter sets, and determining one of the N sixth candidate hyperparameter sets with the smallest model error as the first candidate hyperparameter set.
[0013] In some embodiments, the model parameters of the initial traffic prediction model corresponding to the first candidate hyperparameter set, the initial traffic prediction model corresponding to the second candidate hyperparameter set, the fourth candidate hyperparameter set, the fifth candidate hyperparameter set, and the initial traffic prediction model corresponding to the sixth candidate hyperparameter set are all exactly the same.
[0014] In a second aspect, the present application provides a device for determining a target traffic prediction model, comprising: a module for executing the method described in the first aspect.
[0015] In a third aspect, the present application provides a chip comprising an interface circuit and a logic circuit, wherein the interface circuit is used to receive signals from other chips outside the chip and transmit them to the logic circuit, or to send signals from the logic circuit to other chips outside the chip, and the logic circuit is used to implement the method described in the first aspect.
[0016] In a fourth aspect, the present application provides an electronic device, comprising: a memory and a processor; the memory is configured to store computer program instructions; the processor is configured to run the computer program instructions, so that the electronic device implements the method described in the first aspect.
[0017] In a fifth aspect, the present application provides a computer-readable storage medium, including computer program instructions, and an electronic device runs the computer program instructions so that the electronic device implements the method described in the first aspect.
[0018] In a sixth aspect, the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the steps in the method provided in the first aspect.
[0019] In an embodiment of the present application, multiple rounds of screening processing are performed on multiple preset hyperparameter sets, and in each round of processing, a crossover operation is performed on multiple hyperparameter sets based on a crossover probability; the multiple hyperparameter sets include multiple first hyperparameter sets and multiple second hyperparameter sets, and for each first hyperparameter set and the corresponding second hyperparameter set, the crossover probability based on which whether to perform the crossover operation is determined is based on the minimum error in the model errors corresponding to the multiple first candidate hyperparameter sets, and the comparison result of the minimum error in the model errors corresponding to the current first hyperparameter set and the second hyperparameter set. If the difference between the two is large, it means that the performance of the candidate traffic prediction model corresponding to the first hyperparameter set and the second hyperparameter set is relatively low. In this way, performing a crossover operation in this case helps to improve the performance of the candidate traffic prediction model corresponding to the first hyperparameter set and the second hyperparameter set, thereby helping to obtain a target traffic prediction model with better performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A schematic diagram of the implementation flow of a method for determining a target flow prediction model provided in an embodiment of the present application;
[0021] Figure 2 A schematic diagram of a first hyperparameter set and a second hyperparameter set provided in an embodiment of the present application;
[0022] Figure 3 A schematic diagram of a first hyperparameter set and a second hyperparameter set provided in an embodiment of the present application;
[0023] Figure 4 A schematic diagram of the implementation flow of a method for determining a target flow prediction model provided in an embodiment of the present application;
[0024] Figure 5 A schematic diagram of the implementation flow of a method for determining a target flow prediction model provided in an embodiment of the present application;
[0025] Figure 6 A schematic diagram of the implementation flow of a method for determining a target flow prediction model provided in an embodiment of the present application;
[0026] Figure 7 A schematic diagram of the structure of a device for determining a target flow prediction model provided in an embodiment of the present application;
[0027] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] With the development of the Internet, transportation service platforms have emerged. The transportation service platform is a medium for matching users' transportation needs with the carrier's transportation resources. Users can send the cargo information they need to transport to the transportation service platform through the user client. The transportation service platform will display the cargo information to the carrier through the carrier's client. The carrier will match the cargo based on its own transportation resources to meet the user's transportation needs.
[0029] The number of times the transport service platform displays the cargo information to the carrier, or the number of times the carrier browses the cargo information on the carrier client, can be called the exposure of the cargo information, which is related to the waiting time for the cargo information to be successfully matched. In actual applications, the transport service platform will formulate a traffic management strategy to control the exposure of the cargo information, so as to successfully match the user's transportation needs in a shorter time as much as possible.
[0030] When the transportation service platform manages the flow of received cargo information, it will predict the exposure of cargo information in future time periods based on the exposure of cargo information in historical time periods, and then adjust the exposure of cargo information actually received in future time periods based on the prediction results, so as to better serve users.
[0031] In some embodiments, a neural network model based on deep learning can be used to predict the exposure of the supply information in the future time period. Exemplarily, the actual exposure information of the supply launched on the transport service platform in the first time period is used as the input of the model, and the exposure of the supply launched on the transport service platform in the second time period after the first time period is used as the expected output of the model to train the model. In this way, a flow prediction model that can predict the exposure of the supply in the future time period can be obtained. The flow prediction model can better manage the flow of the supply information launched on the transport platform in the future, thereby meeting the user's usage needs.
[0032] However, the parameters in the traffic prediction model include hyperparameters and model parameters; among them, hyperparameters are set before model training, and hyperparameters are not learned from training data, but are used to guide the learning process of the model. Model parameters are configuration variables in the traffic prediction model, and their values are adjusted during the training process to optimize the performance of the model.
[0033] Among them, for the hyperparameters in the traffic prediction model, different traffic prediction models are generally trained by manually adjusting the hyperparameters or by randomly adjusting the hyperparameters by the device. For example: different traffic prediction models are generally trained by manually adjusting the hyperparameters. For example: for the initial traffic prediction model to be trained, multiple hyperparameter sets are manually set, and the candidate traffic prediction model corresponding to each hyperparameter set is obtained by training the initial traffic prediction model corresponding to the hyperparameter set. Then, the target traffic prediction model that meets the performance requirements is selected from the candidate traffic prediction models for use.
[0034] However, the above method does not further transform and screen the existing multiple hyperparameter sets to obtain more diverse hyperparameter sets with smaller model errors. The types of hyperparameter sets are limited, the model errors are large, and the model performance of the target traffic prediction model determined based on the candidate traffic prediction model corresponding to the hyperparameter set is poor.
[0035] Based on this, an embodiment of the present application provides a method for determining a target traffic prediction model. The present application performs multiple rounds of screening and crossover operations on multiple existing hyperparameter sets to obtain a second candidate hyperparameter set with more types and better model parameters. The multiple hyperparameter sets include multiple first hyperparameter sets and multiple second hyperparameter sets. For each first hyperparameter set and the corresponding second hyperparameter set, the crossover probability based on whether to perform the crossover operation is determined based on the minimum error in the model errors corresponding to the multiple first candidate hyperparameter sets, and the comparison result of the minimum error in the model errors corresponding to the current first hyperparameter set and the second hyperparameter set. In this way, it helps to improve the performance of the candidate traffic prediction models corresponding to the first hyperparameter set and the second hyperparameter set, thereby helping to obtain a target traffic prediction model with better performance.
[0036] Figure 1 A schematic diagram of the implementation flow of the method for determining the target flow prediction model provided in the embodiment of the present application is shown in FIG. Figure 1 As shown, the method includes S101 to S110:
[0037] S101. Determine multiple first candidate hyperparameter sets.
[0038] In the embodiment of the present application, to determine the target traffic prediction model, it is necessary to execute S101 to S109 once, or to execute S101 to S109 multiple times in a loop.
[0039] When S101 to S109 are executed multiple times in a loop, for the first round of loop, a plurality of first candidate hyperparameter sets are determined from a plurality of preset hyperparameter sets.
[0040] For each subsequent cycle, multiple first candidate hyperparameter sets are obtained from multiple second candidate hyperparameter sets in S109 of the previous cycle.
[0041] The method of determining multiple first candidate hyperparameter sets from multiple second candidate hyperparameter sets is the same as the method of determining multiple first candidate hyperparameter sets from multiple preset hyperparameter sets. Here, determining multiple first candidate hyperparameter sets from multiple preset hyperparameter sets is taken as an example.
[0042] Sort multiple hyperparameter sets in order of model error from small to large, and select multiple first candidate hyperparameter sets with top rankings from the multiple candidate hyperparameter sets according to a preset ratio; or, loop the following operation multiple times to obtain multiple first candidate hyperparameter sets: randomly select N sixth candidate hyperparameter sets from the multiple hyperparameter sets, and determine the one with the smallest model error among the N sixth candidate hyperparameter sets as the first candidate hyperparameter set.
[0043] The preset multiple hyperparameter sets can be set according to actual needs. Each hyperparameter set includes multiple hyperparameters; the number of hyperparameters in each hyperparameter set is the same. Each hyperparameter set is not completely the same, and can be partially different or completely different.
[0044] The traffic prediction model involved in the embodiment of the present application can be a lightweight gradient boosting machine (LightGradient Boosting Machine, LightGBM) model. The LightGBM model is an implementation of the gradient boosting decision tree. Exemplarily, the multiple hyperparameters in each hyperparameter set are: the number of decision trees (n_estimators), the number of leaf nodes of the tree (num_leaves), the learning rate (learning_rate), the maximum tree depth (max_depth), the minimum amount of data on each leaf node (min_data_in_leaf), the feature ratio sampled when training each tree (feature_fraction), the sample ratio used when training each tree (bagging_fraction), the weight of the L1 regularization term (lambda_l1), the weight of the L2 regularization term (lambda_l2), etc.
[0045] Each hyperparameter set corresponds to an initial traffic prediction model; wherein the model parameters of the initial traffic prediction model are untrained initial parameters.
[0046] When determining multiple first candidate hyperparameter sets from multiple hyperparameter sets, the initial traffic prediction models corresponding to the multiple hyperparameter sets can be trained to obtain multiple trained candidate traffic prediction models, and multiple first candidate traffic prediction models that meet the first preset condition are determined based on the model errors of the multiple candidate traffic prediction models, and the hyperparameter sets corresponding to the multiple first candidate traffic prediction models are determined as multiple first candidate hyperparameter sets.
[0047] For the initial traffic prediction model corresponding to any hyperparameter set, the initial traffic prediction model can be trained in the following ways: obtaining training samples from the training sample set; inputting the training samples into the initial traffic prediction model, and iteratively training the initial traffic prediction model based on the expected output of the training samples until the iteration stop condition is met.
[0048] The training samples include: the exposure information of the supply sources launched in the first time period, which is obtained by statistics. Specifically, it includes: the exposure information of the supply sources launched in the first time period in each life cycle of the supply sources. In some embodiments, the training samples also include weather data and holiday data in the first time period.
[0049] The expected output corresponding to the training sample is the exposure result of the source of goods launched in the second time period, which is obtained by statistics, and specifically includes: the exposure of the source of goods launched in the second time period in each life cycle of the source of goods.
[0050] The first time period is before the second time period.
[0051] The iterative stopping condition for training the initial traffic prediction model may be: the loss function between the expected output and the prediction result gradually decreases until it no longer changes.
[0052] In some embodiments, the determined multiple first candidate hyperparameter sets may be divided into two groups, one group including multiple first hyperparameter sets, and the other group including multiple second hyperparameter sets.
[0053] Exemplarily, assume that multiple first candidate hyperparameter sets include hyperparameter set 1, hyperparameter set 2, ..., hyperparameter set M, which are numbered 1, 2, ..., M respectively; M is greater than or equal to 2, and M is an even number.
[0054] The hyperparameter set 1, hyperparameter set 3, ..., and hyperparameter set M-1 with odd serial numbers can be determined as the first group of hyperparameter sets, and the hyperparameter set 1, hyperparameter set 3, ..., and hyperparameter set M-1 are the multiple first hyperparameter sets; their serial numbers in the group of hyperparameter sets are 1, 2, ..., and M / 2 respectively. The hyperparameter set 2, hyperparameter set 4, ..., and hyperparameter set M with even serial numbers are determined as the second group of hyperparameter sets, and the hyperparameter set 2, hyperparameter set 4, ..., and hyperparameter set M are the multiple second hyperparameter sets, and their serial numbers in the second group of hyperparameter sets are 1, 2, ..., and M / 2 respectively.
[0055] The plurality of first hyperparameter sets and the plurality of second hyperparameter sets correspond one to one. Specifically, in the first group of hyperparameter sets and the second group of hyperparameter sets, the first hyperparameter sets and the second hyperparameter sets with the same sequence number correspond one to one.
[0056] Exemplarily, hyperparameter set 1 corresponds to hyperparameter set 2, hyperparameter set 3 corresponds to hyperparameter set 4, ..., hyperparameter set M-1 corresponds to hyperparameter set M.
[0057] It should be noted that the division of the above-mentioned multiple first hyperparameter sets and multiple second hyperparameter sets is only an example of the present application. In actual use, multiple first hyperparameter sets and multiple second hyperparameter sets can also be determined by other means, and the present application does not limit this.
[0058] S102. For each first hyperparameter set and the corresponding second hyperparameter set in the multiple first candidate hyperparameter sets, respectively determine at least one first target hyperparameter in the first hyperparameter set and at least one second target hyperparameter in the second hyperparameter set, and when the randomly generated first numerical value is less than the crossover probability, swap at least one first target hyperparameter in the first hyperparameter set with at least one second target hyperparameter in the second hyperparameter set to obtain a second candidate hyperparameter set.
[0059] In some embodiments, it is possible to use Figure 2 How to determine at least one first target hyperparameter and at least one second target hyperparameter is exemplified.
[0060] Figure 2 A schematic diagram of a first hyperparameter set and a second hyperparameter set provided in an embodiment of the present application.
[0061] For the convenience of description below, hyperparameters can also be described as "hyperparameters".
[0062] like Figure 2 As shown, the first hyperparameter set includes 8 hyperparameters. They are hyperparameters 11 to 18, and their serial numbers in the first hyperparameter set are 1 to 8 respectively; the second hyperparameter set includes 8 hyperparameters, which are hyperparameters 21 to 28, and their serial numbers in the second hyperparameter set are 1 to 8 respectively. Among them, the hyperparameters with the same serial number have the same definition in the corresponding hyperparameter set. For example, hyperparameter 1 in the first hyperparameter set and hyperparameter 1 in the second hyperparameter set are both used to represent the number of decision trees.
[0063] Determine a split node, for example, take the second hyperparameter as the split node, and divide the first hyperparameter set and the second hyperparameter set into two parts of hyperparameters.
[0064] The two parts of hyperparameters corresponding to the first hyperparameter set are: hyperparameters 11 to 12, and hyperparameters 13 to 18; the two parts corresponding to the second hyperparameter set are: hyperparameters 21 to 22, and hyperparameters 23 to 28.
[0065] The hyperparameters of any corresponding part are used as the corresponding target hyperparameters. Exemplarily, hyperparameters 11 to 12 are used as at least one first target hyperparameter, and hyperparameters 11 to 12 are used as at least one second target hyperparameter.
[0066] Alternatively, multiple split nodes are determined. For example, the second hyperparameter and the fourth hyperparameter are used as split nodes to divide the first hyperparameter set and the second hyperparameter set into three hyperparameter parts respectively.
[0067] The three parts of hyperparameters corresponding to the first hyperparameter set are: hyperparameters 11 to 12, hyperparameters 13 to 14, and hyperparameters 15 to 18. The three parts of hyperparameters corresponding to the second hyperparameter set are: hyperparameters 21 to 22, hyperparameters 23 to 24, and hyperparameters 25 to 28. Any one or two of the corresponding parts of hyperparameters are used as corresponding target hyperparameters. Exemplarily, hyperparameters 11 to 12, and hyperparameters 13 to 14 are used as at least one first target hyperparameter, and hyperparameters 21 to 22, and hyperparameters 23 to 24 in the second hyperparameter set are used as at least one second target hyperparameter.
[0068] The following takes the first target hyperparameters as hyperparameters 11 and 12, and the second target hyperparameters as hyperparameters 21 and 22 as an example to illustrate the swap operation:
[0069] Hyperparameters 11 and 12 are removed from the first hyperparameter set, and hyperparameters 21 and 22 are added to the first hyperparameter set as the first hyperparameter and the second hyperparameter in the first hyperparameter set.
[0070] Hyperparameters 21 and 22 are removed from the second hyperparameter set, and hyperparameters 11 and 22 are added to the second hyperparameter set as the first and second hyperparameters in the second hyperparameter set.
[0071] The first hyperparameter set and the second hyperparameter set obtained after the swap operation are as follows Figure 3 shown.
[0072] The above-mentioned interchange operation can also be described as a crossover operation of the first hyperparameter set and the second hyperparameter set. In the present application, for each first hyperparameter set and the corresponding second hyperparameter set, whether to perform a crossover operation is determined based on whether the randomly generated first value is less than the crossover probability. If it is less than the crossover probability, the crossover operation is performed; if it is greater than or equal to the crossover probability, the crossover operation is not performed. In this way, after performing the above-mentioned operations on each first hyperparameter set and the corresponding second hyperparameter set, a plurality of second candidate hyperparameter sets are obtained. The plurality of second candidate hyperparameter sets include the first hyperparameter set and the second hyperparameter set on which the crossover operation is performed, and also include the first hyperparameter set and the second hyperparameter set on which the crossover operation is not performed.
[0073] Whether a crossover operation is performed on the first hyperparameter set and the corresponding second hyperparameter set is determined by the crossover probability based on the first minimum error among the model errors corresponding to multiple first candidate hyperparameter sets, and the second minimum error among the model errors corresponding to the first hyperparameter set and the model errors corresponding to the second hyperparameter set.
[0074] The model error corresponding to the first candidate hyperparameter set, that is, the model error of the first candidate traffic prediction model corresponding to the first candidate hyperparameter set.
[0075] The model error corresponding to the first hyperparameter set, that is, the model error of the first candidate traffic prediction model corresponding to the first hyperparameter set; the model error corresponding to the second hyperparameter set, that is, the model error of the first candidate traffic prediction model corresponding to the second hyperparameter set.
[0076] The smaller the model error of the first candidate traffic prediction model, the higher the performance and accuracy of the first candidate traffic prediction model, that is, the higher the prediction accuracy. In the present application, the crossover probability is determined based on the comparison result of the minimum model error corresponding to multiple first candidate hyperparameters and the minimum model error of the first hyperparameter set and the second hyperparameter set to be crossed. If the difference between the former and the latter is large, it means that the first candidate traffic model corresponding to the first hyperparameter set or the second candidate traffic model corresponding to the second hyperparameter set has poor performance, that is, the crossover probability is large, and a crossover operation is required to update the current first hyperparameter set and the second hyperparameter set, in order to obtain a target traffic prediction model with better performance based on the updated second candidate hyperparameter set.
[0077] S103. For each second candidate hyperparameter set, the statistical exposure information of the sources of goods online in the first time period is input into the initial traffic prediction model corresponding to the second candidate hyperparameter set. The initial traffic prediction model corresponding to the second candidate hyperparameter set is iteratively trained based on the statistical exposure results of the sources of goods online in the second time period until the iteration stop condition is met, thereby obtaining the second candidate traffic prediction model corresponding to the second candidate hyperparameter set.
[0078] In some embodiments, the model parameters in the initial traffic prediction model involved in the present application are all the same and are initial parameters.
[0079] The specific implementation of training the initial traffic prediction model corresponding to the second candidate hyperparameter set is similar to the specific implementation of training the initial traffic prediction model corresponding to the first candidate hyperparameter set mentioned above, and will not be repeated here.
[0080] S104. Obtain a model error corresponding to a second candidate hyperparameter set based on a prediction result of the second candidate traffic prediction model for the exposure information of the inputted sources of goods online in the first time period and the exposure result of the sources of goods online in the second time period.
[0081] Furthermore, the difference between the two is the model error corresponding to the second candidate hyperparameter set.
[0082] The model error corresponding to the second candidate hyperparameter set, that is, the model error corresponding to the second candidate traffic prediction model corresponding to the second candidate hyperparameter set.
[0083] The prediction result of the exposure information of the source of goods online in the first time period in this step is, that is, the output result obtained by inputting the exposure information of the source of goods online in the first time period into the trained second candidate traffic prediction model.
[0084] Since the crossover probability between each first hyperparameter set and the corresponding second hyperparameter set is determined based on the first minimum error in the model errors corresponding to the multiple first candidate hyperparameter sets, and the comparison result between the model error corresponding to the first hyperparameter set and the second minimum error in the model error corresponding to the second hyperparameter set, after performing a crossover operation based on the crossover probability or not performing a crossover operation on each first hyperparameter set and the corresponding hyperparameter set, the multiple second candidate hyperparameter sets obtained are more likely to obtain a higher-performance traffic prediction model than the multiple first candidate hyperparameter sets, and the target traffic prediction model can be further determined based on the model errors corresponding to the multiple second candidate hyperparameter sets.
[0085] S109: Determine whether the model errors corresponding to the current multiple second candidate hyperparameter sets are all less than or equal to the first preset threshold, and whether the number of times the first candidate hyperparameter set is updated is greater than or equal to the second preset threshold.
[0086] It can be understood that each time a round of S101 to S109 is executed, a crossover operation is performed on multiple first candidate hyperparameter sets to update multiple first candidate hyperparameter sets to obtain multiple first candidate hyperparameter sets. The number of times the multiple first candidate hyperparameter sets are updated is the number of times S101 to S109 are executed in a loop.
[0087] If the model errors corresponding to the current multiple second candidate hyperparameter sets are all less than or equal to the first preset threshold, and the number of times the first candidate hyperparameter set is updated is greater than or equal to the second preset threshold, execute S110.
[0088] If, among the current multiple second candidate hyperparameter sets, there is a second candidate hyperparameter set whose model error is greater than the first preset threshold, or the number of times the first candidate hyperparameter set is updated is less than the second preset threshold, then for the current multiple second candidate hyperparameter sets, return to execute the operation S101 to determine the next cycle of the target traffic prediction model.
[0089] For the next cycle, multiple first candidate hyperparameter sets are re-determined from multiple second candidate hyperparameter sets, wherein the method of determining multiple first candidate hyperparameter sets from multiple second candidate hyperparameter sets is the same as the method of determining multiple first candidate hyperparameter sets from multiple hyperparameter sets in the first cycle, and will not be repeated here.
[0090] S110. Determine the second candidate traffic prediction model with the smallest model error among the current multiple second candidate hyperparameter sets as the target traffic prediction model.
[0091] The target traffic prediction model is used to predict the exposure results of the sources of goods that will be launched in the future time period based on the exposure information of the sources of goods that were launched in the historical event period obtained by statistics.
[0092] In the embodiment of the present application, determining the target traffic prediction model needs to go through at least one cycle. Specifically, first determine multiple first candidate hyperparameter sets from multiple preset hyperparameter sets whose model errors meet preset conditions, and for each first hyperparameter set and the corresponding second hyperparameter set in the multiple first candidate hyperparameter sets, based on the first value randomly generated being less than the crossover probability, perform a crossover operation on the first hyperparameter set and the corresponding second hyperparameter set to update the multiple first candidate hyperparameter sets to obtain multiple second candidate hyperparameter sets; then, based on whether the loop stop condition is currently met, determine whether to determine the target traffic prediction model from the candidate traffic prediction models corresponding to the multiple second candidate hyperparameter sets, or continue to determine multiple first candidate hyperparameter sets for the multiple second candidate hyperparameter sets to perform the crossover operation again until the loop stop condition is met. Since the crossover probability based on whether the first hyperparameter set and the corresponding second hyperparameter set perform a crossover operation in each cycle is determined based on the comparison result of the first minimum error in the model errors corresponding to the multiple first candidate hyperparameter sets and the second minimum error in the model errors corresponding to the first hyperparameter set and the second hyperparameter set to be crossed; if the first minimum error and the second minimum error differ greatly, it means that the performance of the candidate traffic prediction model corresponding to the first hyperparameter set and the second hyperparameter set needs to be improved. In this way, performing a crossover operation in this case helps to improve the performance of the candidate traffic prediction model corresponding to the first hyperparameter set and the second hyperparameter set, thereby obtaining a target candidate traffic prediction model with better performance.
[0093] As described above, the crossover probability according to which the first hyperparameter set and the second hyperparameter set are crossovered is determined based on the first minimum error among the model errors corresponding to the plurality of first candidate hyperparameter sets, and the second minimum error among the model errors corresponding to the first hyperparameter set and the model errors corresponding to the second hyperparameter set. Figure 4The embodiment illustrates a specific method for determining the crossover probability.
[0094] Figure 4 A schematic diagram of the implementation flow of the method for determining the target flow prediction model provided in the embodiment of the present application is shown in FIG. Figure 4 As shown, S102 can be implemented through steps a1 to a4:
[0095] Step a1: Obtain a first hyperparameter set and a corresponding second hyperparameter set from a plurality of first candidate hyperparameter sets.
[0096] Since the first candidate hyperparameter set includes multiple first hyperparameter sets and multiple second hyperparameter sets, steps a1 to a4 need to be performed in multiple rounds.
[0097] Among them, the first hyperparameter set obtained in each round is different.
[0098] Step a2: Based on the first minimum error in the model errors corresponding to all first candidate hyperparameter sets and the second minimum error in the model errors corresponding to the current first hyperparameter set and the current second hyperparameter set, determine the crossover probability of the current round by formula one or formula two.
[0099]
[0100]
[0101] Among them, p c is the current crossover probability, f min1 is the first minimum error, f1 is the second minimum error, and f min1 -f1 and, Characterizes the comparison result of the first minimum error and the second minimum error, c1 is a preset initial crossover probability. c1 can be set according to actual needs. max1 is the first maximum error among the model errors corresponding to the multiple first candidate hyperparameter sets.
[0102] It can be understood that since the first hyperparameter set obtained in each round is different, the corresponding second hyperparameter set is different, and the second minimum error determined in each round may also be different, that is, the crossover probability determined in each round may be different.
[0103] Step a3: When the randomly generated first numerical value is less than the crossover probability, at least one first target hyperparameter in the first hyperparameter set is exchanged with at least one second target hyperparameter in the second hyperparameter set to obtain two second candidate hyperparameter sets.
[0104] If the randomly generated first value is greater than or equal to the crossover probability, the current first hyperparameter set and the second hyperparameter set are determined as the second candidate hyperparameter set.
[0105] It should be noted that in each cycle, the randomly generated first value may be the same or different.
[0106] Step a4: determine whether all the first hyperparameter sets in the first candidate hyperparameter set have been acquired.
[0107] If not, execute step a1 to obtain the first hyperparameter set again; if so, end the current loop and execute step S103.
[0108] It can be seen that steps a1 to a4 are executed in a loop until the first hyperparameter set is obtained, that is, multiple first candidate hyperparameter sets are updated once to obtain multiple second candidate hyperparameter sets. The multiple second candidate hyperparameter sets include the first hyperparameter set and the second hyperparameter set that have performed a crossover operation, and also include the first hyperparameter set and the second hyperparameter set that have not performed a crossover operation.
[0109] The crossover probability is determined based on the comparison result of the first minimum error and the second minimum error. The larger the first minimum error-second minimum error, or the larger the (first maximum error-second minimum error) / (first maximum error-first minimum error), the poorer the performance of the candidate traffic prediction model corresponding to the first hyperparameter set and the second hyperparameter set. The larger the crossover probability, the greater the probability of performing the crossover operation. In this way, when the performance of the candidate traffic prediction model corresponding to the first hyperparameter set and the second hyperparameter set is poor, there is a greater probability to update the first hyperparameter set and the second hyperparameter set in order to obtain a second hyperparameter set with a smaller model error.
[0110] Above Figure 1 During each cycle of the embodiment, after performing the crossover operation on multiple first candidate hyperparameter sets to update the multiple first candidate hyperparameters, the multiple second candidate hyperparameters obtained based on the update can be mutated and perturbed to update the second candidate hyperparameters again, so that the performance of the candidate traffic prediction model corresponding to the updated second candidate hyperparameter set is better.
[0111] Next, through Figure 5 The embodiment exemplifies the specific implementation process of the mutation operation. Figure 5 The following is a schematic diagram of the implementation process of the target flow prediction model provided in the embodiment of the present application. Figure 5 As shown, after S104, the method further includes S105 to S108a, and accordingly, S109 to S110 can be implemented by S109a to S110a:
[0112] S105: Determine, among the multiple second candidate hyperparameter sets, multiple third candidate hyperparameter sets whose model errors satisfy the second preset condition.
[0113] In some embodiments, the plurality of second candidate hyperparameter sets may be sorted in order of model error from small to large, and a plurality of third candidate hyperparameter sets with top rankings may be selected from the plurality of second candidate hyperparameter sets according to a preset ratio. That is, the second preset condition is: the third candidate hyperparameter sets with top rankings and the number of third candidate hyperparameter sets with the preset ratios are met.
[0114] For example, the plurality of second candidate hyperparameter sets are sorted in order of model error from small to large as: set 1, set 2, set 3, set 4. The preset ratio is 50%, and the plurality of third candidate hyperparameter sets include: set 1 and set 2.
[0115] In some other embodiments, multiple third candidate hyperparameter sets may be selected in the following manner: randomly determine N sixth candidate hyperparameter sets from multiple second candidate hyperparameter sets, determine the sixth candidate hyperparameter set with the smallest model error among the N sixth candidate hyperparameter sets, determine the sixth candidate hyperparameter set as the third candidate hyperparameter set, and repeat the above operation until the stop condition is met, N is greater than 1 and less than the number of hyperparameters in the third candidate hyperparameter set; multiple third candidate hyperparameter sets can be obtained; wherein the N sixth candidate hyperparameter sets randomly determined each time may be the same or different. The stop condition is to repeat the loop J times, where J is determined according to the actual situation.
[0116] S106. For each third candidate hyperparameter set, determine at least one third target hyperparameter in the third candidate hyperparameter set, and based on the randomly generated second numerical value being less than the mutation probability, change at least one third target hyperparameter in the third candidate hyperparameter set to obtain multiple fourth candidate hyperparameter sets; wherein the mutation probability is determined based on the third minimum error among the model errors corresponding to the multiple third candidate hyperparameter sets, and a comparison result of the model error corresponding to the current third candidate hyperparameter set.
[0117] In some embodiments, the third target hyperparameter may be a hyperparameter with a specific serial number in the third candidate hyperparameter set, for example, a hyperparameter with serial number 1 and serial number 2. The specific serial number does not change during each loop. In other embodiments, the specific serial number changes during each loop.
[0118] The mutation probability is determined by the third minimum error among the model errors corresponding to the multiple third candidate hyperparameter sets and the comparison result of the model error corresponding to the current third candidate hyperparameter set. If the difference between the two is large, it means that the performance of the candidate traffic prediction model corresponding to the current third candidate hyperparameter set is not good, and the current third candidate hyperparameter set needs to be mutated to obtain a candidate traffic prediction model with better performance, thereby obtaining a target traffic prediction model with better performance.
[0119] Changing the third target hyperparameter in the third candidate hyperparameter set may include determining a hyperparameter having a value close to the third target hyperparameter, and using the hyperparameter to update the third target hyperparameter.
[0120] S107. For each fourth candidate hyperparameter set in multiple fourth candidate hyperparameter sets, the exposure information of the supply that went online in the first time period is input into the initial traffic prediction model corresponding to the fourth candidate hyperparameter set, and the initial traffic prediction model is iteratively trained based on the exposure results of the supply that went online in the second time period until the iteration stop condition is met, so as to obtain the fourth candidate traffic prediction model corresponding to the fourth candidate hyperparameter set.
[0121] In this embodiment, the method of iteratively training the initial traffic prediction model corresponding to the fourth candidate hyperparameter set is similar to the method of iteratively training the initial traffic prediction model corresponding to the first candidate hyperparameter set, which is not repeated here.
[0122] S108. Determine the model errors corresponding to the multiple fourth candidate traffic prediction models based on the prediction results of the exposure information of the input supply sources that went online in the first time period and the statistical exposure results of the supply sources that went online in the second time period.
[0123] Furthermore, the difference between the two is the model error corresponding to the fourth candidate hyperparameter set.
[0124] The prediction result of the exposure information of the source of goods online in the first time period in this step is, that is, the output result obtained by inputting the exposure information of the source of goods online in the first time period into the trained fourth candidate traffic prediction model.
[0125] S108a. Perform a perturbation operation on multiple fourth candidate hyperparameter sets, and obtain multiple fifth candidate hyperparameter sets based on model errors corresponding to the multiple fourth candidate hyperparameter sets.
[0126] Specifically, step S108a can be implemented by following steps d1 to d2 (not shown in the figure):
[0127] Step d1: for each fourth candidate hyperparameter set, based on Formula 5, perturb the hyperparameters in the fourth candidate hyperparameter set to obtain the corresponding sixth candidate hyperparameter set:
[0128]
[0129] in, is the sixth candidate hyperparameter set, is the corresponding fourth candidate hyperparameter set; r is a vector composed of multiple random numbers, and the multiple random numbers correspond one-to-one to all the hyperparameters in the fourth candidate hyperparameter set; T is the second preset threshold (that is, the rounds of executing S101 to S109a), t is the number of times the fifth candidate hyperparameter set is currently updated (that is, the rounds of executing S101 to S109a), i is the serial number of the fourth candidate hyperparameter set, and j represents the serial number of the hyperparameter in the fourth candidate hyperparameter set; i is greater than 0 and less than the number of the fourth candidate hyperparameter set; j is greater than 0 and less than or equal to the number of hyperparameters in the fourth candidate hyperparameter set.
[0130] For each fourth candidate hyperparameter set, after performing a perturbation operation on the fourth candidate hyperparameter set using Formula 5, a sixth candidate hyperparameter set corresponding to each fourth candidate hyperparameter set is obtained.
[0131] Next, each sixth candidate hyperparameter set is judged through step d2 to determine whether to determine the sixth candidate hyperparameter set as the fifth candidate hyperparameter set, or to determine the fourth candidate hyperparameter set before perturbation as the fifth candidate hyperparameter set.
[0132] Step d2: for each sixth candidate hyperparameter set, determine the model error corresponding to the sixth candidate hyperparameter set; if the model error of the sixth candidate hyperparameter set is smaller than the model error corresponding to the corresponding fourth candidate hyperparameter set, determine the sixth candidate hyperparameter set as the fifth candidate hyperparameter set; if the model error of the sixth candidate hyperparameter set is larger than the model error corresponding to the corresponding fourth candidate hyperparameter set, based on the fact that the randomly generated third numerical value is less than the perturbation probability, determine the sixth candidate hyperparameter set as the fifth candidate hyperparameter set.
[0133] The perturbation probability is determined according to the following formula 6:
[0134] P w =e -a×t×[f(t+1)-f(t)] Formula 6;
[0135] Among them, P wis the perturbation probability, a is a constant, t is the number of times the fifth candidate hyperparameter set is currently updated, f(t+1) is the model error of the current sixth candidate hyperparameter set, and f(t) is the error of the corresponding fourth candidate hyperparameter set.
[0136] The method for determining the model error corresponding to the sixth candidate hyperparameter set is similar to the method for determining the model error corresponding to the fourth candidate hyperparameter set mentioned above. Both methods involve training the initial traffic prediction model corresponding to the sixth candidate hyperparameter set to obtain the candidate traffic prediction model corresponding to the sixth candidate hyperparameter set, and then calculating the error of the corresponding candidate traffic prediction model. The specific method can be referred to the method for determining the model error corresponding to the fourth candidate hyperparameter set mentioned above, which will not be repeated here.
[0137] After executing step d2, multiple fifth candidate hyperparameter sets can be obtained.
[0138] S109a, determining whether the model errors corresponding to the current multiple fifth candidate traffic prediction models are all smaller than the third preset threshold, and whether the number of times the multiple fifth candidate hyperparameter sets are updated is greater than or equal to the second preset threshold.
[0139] It can be understood that each time a round of S101 to S109a is executed, multiple third candidate hyperparameter sets are determined, and multiple third candidate hyperparameter sets are mutated and perturbed to update the multiple third candidate hyperparameter sets to obtain multiple fifth candidate hyperparameter sets. Then, the number of times the multiple fifth candidate hyperparameter sets are updated is the number of times S101 to S109a are executed in a loop.
[0140] The third preset threshold may be the same as the first preset threshold. If the model errors corresponding to the current plurality of fifth candidate hyperparameter sets are all less than or equal to the third preset threshold, and the number of times the fifth candidate hyperparameter set is updated is greater than or equal to the second preset threshold, S110a is executed.
[0141] If, among the current multiple fifth candidate hyperparameter sets, there is a fifth candidate hyperparameter set whose model error is greater than the third preset threshold, or the number of times the multiple fifth candidate hyperparameter sets are updated is less than the second preset threshold, then for the current multiple fifth candidate hyperparameter sets, return to execution S101 to S109a and enter the next cycle of the process of determining the target traffic prediction model.
[0142] In this embodiment, in the next cycle, multiple first candidate hyperparameter sets are determined from the current multiple fifth candidate hyperparameter sets.
[0143] The method of determining multiple first candidate hyperparameter sets from the current multiple fifth candidate hyperparameter sets is the same as the method of determining multiple first candidate hyperparameter sets from multiple hyperparameter sets, which will not be described in detail here.
[0144] S110a. Determine the fifth candidate traffic prediction model with the smallest model error among the current multiple fifth candidate hyperparameter sets as the target traffic prediction model.
[0145] In this embodiment, after performing a crossover operation on multiple first candidate hyperparameter sets, multiple second candidate hyperparameter sets are obtained, multiple third candidate hyperparameter sets that meet the second preset condition are determined from the multiple second candidate hyperparameter sets, and a mutation operation and a perturbation operation are performed again on the model errors corresponding to the multiple third candidate hyperparameter sets to obtain multiple fifth candidate hyperparameter sets. In this way, the initial traffic prediction model corresponding to the obtained fifth candidate hyperparameter set has better model performance after training.
[0146] As described above, the mutation probability according to which at least one third target hyperparameter in the third candidate hyperparameter set is subjected to a mutation operation is determined based on the third minimum error among the model errors corresponding to the plurality of third candidate hyperparameter sets and the model error corresponding to the current third candidate hyperparameter set. Figure 6 The embodiment illustrates a specific method for determining the mutation probability.
[0147] Figure 6 The method for determining the target flow prediction model provided in the embodiment of the present application is as follows: Figure 6 As shown, S106 can be implemented through steps b1 to b4:
[0148] Step b1: Obtain a third candidate hyperparameter set from multiple third candidate hyperparameter sets.
[0149] Since there are multiple third candidate hyperparameter sets, steps b1 to b4 need to be performed in multiple rounds.
[0150] Among them, the third candidate hyperparameter set obtained in each round is different.
[0151] Step b2: Based on the third minimum error among the model errors corresponding to all third candidate hyperparameter sets and the model error corresponding to the current third candidate hyperparameter set, determine the mutation probability of this round by using Formula 3 or Formula 4.
[0152]
[0153] Among them, p m is the mutation probability, f min2 is the third minimum error, f2 is the model error corresponding to the current third candidate hyperparameter combination, and c is the preset initial mutation probability. max2 is the third largest error among the model errors corresponding to the multiple third candidate hyperparameter sets. min2 -f2 and is the comparison result of the third minimum error and the model error corresponding to the current third candidate hyperparameter set.
[0154] It can be understood that since the third candidate hyperparameter set obtained in each round is different, the mutation probability determined in each round may be different.
[0155] Step b3: When the randomly generated second numerical value is less than the mutation probability, at least one third target hyperparameter in the current third candidate hyperparameter set is changed to obtain a fourth candidate hyperparameter set.
[0156] It should be noted that in each cycle, the randomly generated second value may be the same or different.
[0157] Step b4: determine whether all third candidate hyperparameter sets in the plurality of third candidate hyperparameter sets have been acquired.
[0158] If not, execute step b1 to obtain the third candidate hyperparameter set again. If so, end the current loop and execute step S107.
[0159] It can be seen that steps b1 to b4 are executed in a loop until the third candidate hyperparameter set is obtained, that is, multiple third candidate hyperparameter sets are updated once to obtain multiple fourth candidate hyperparameter sets. The multiple fourth candidate hyperparameter sets include third candidate hyperparameter sets that have been mutated and third candidate hyperparameter sets that have not been mutated.
[0160] The mutation probability is determined based on the difference between the third minimum error and the model error corresponding to the current third candidate hyperparameter set. The larger the difference, the greater the mutation probability, that is, the greater the probability of performing the mutation operation. In this way, when the performance of the candidate traffic prediction model corresponding to the third candidate hyperparameter set is poor, the third candidate hyperparameter set is updated in the hope of obtaining a fourth candidate hyperparameter set with a smaller model error.
[0161] It should be noted that although the steps of the method in the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.; or, steps in different embodiments may be combined into a new technical solution.
[0162] Based on the foregoing embodiments, an embodiment of the present application provides a target traffic prediction model determination device, which includes the modules included and the units included in the modules, and can be implemented by a processor; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.
[0163] Figure 7 A schematic diagram of the structure of a target flow prediction model determination device provided in an embodiment of the present application, such as Figure 7 As shown, the target flow prediction model determination device 70 includes a hyperparameter set determination module 71, a training module 72, a model error determination module 73 and a target flow prediction model determination module 74, wherein:
[0164] The hyperparameter set determination module 71 is used to determine multiple first candidate hyperparameter sets from multiple preset hyperparameter sets; wherein, after the initial traffic prediction model corresponding to the first candidate hyperparameter set is trained, the model error of the first candidate traffic prediction model obtained satisfies the first preset condition; the number of hyperparameters in each of the first candidate hyperparameter sets is the same; the multiple first candidate hyperparameter sets include multiple first hyperparameter sets and multiple second hyperparameter sets, and the multiple first hyperparameter sets correspond to the multiple second hyperparameter sets one by one; for each first hyperparameter set and the corresponding second hyperparameter set in the multiple first candidate hyperparameter sets, at least one first target hyperparameter in the first hyperparameter set and at least one second target hyperparameter in the second hyperparameter set are determined respectively, and when the randomly generated first numerical value is less than the crossover probability, the at least one first target hyperparameter in the first hyperparameter set is exchanged with the at least one second target hyperparameter in the second hyperparameter set to obtain multiple second candidate hyperparameter sets; wherein the crossover probability is determined based on the first minimum error in the model errors corresponding to the multiple first candidate hyperparameter sets, and the comparison result of the model error corresponding to the first hyperparameter set and the second minimum error in the model error corresponding to the second hyperparameter set.
[0165] The training module 72 is used to input the exposure information of the supply source online in the first time period into the initial traffic prediction model corresponding to the second candidate hyperparameter set for each of the second candidate hyperparameter sets, and iteratively train the initial traffic prediction model corresponding to the second candidate hyperparameter set based on the exposure results of the supply source online in the second time period until the iteration stop condition is met, so as to obtain the second candidate traffic prediction model corresponding to the second candidate hyperparameter set; wherein, the first time period is before the second time period.
[0166] The model error determination module 73 is used to obtain the model error of the second candidate traffic prediction model corresponding to the second candidate hyperparameter set based on the prediction result of the exposure information of the supply that goes online in the input first time period and the exposure result of the second candidate traffic prediction model.
[0167] The hyperparameter set determination module 71 is further used to, when there is a second candidate hyperparameter set whose model error is greater than the first preset threshold among the multiple second candidate hyperparameter sets, or when the number of times the first candidate hyperparameter set is updated is less than the second preset threshold, return to the operation of determining multiple first candidate hyperparameter sets from the multiple second candidate hyperparameter sets and updating the multiple first candidate hyperparameter sets for the multiple second candidate hyperparameter sets, until the model errors corresponding to the updated multiple second candidate hyperparameter sets are all less than or equal to the first preset threshold, and the number of times the multiple first candidate hyperparameter sets are updated is greater than or equal to the second preset threshold.
[0168] The target traffic prediction model determination module 74 is used to determine the second candidate traffic prediction model with the smallest model error among the current multiple second candidate hyperparameter sets as the target traffic prediction model; wherein the target traffic prediction model is used to predict the exposure results of the sources of goods that will be online in the future time period based on the exposure information of the sources of goods that were online in the historical time period obtained by statistics.
[0169] In some embodiments, the hyperparameter set determination module 71 is further used to determine the crossover probability based on the first minimum error and the second minimum error through Formula 1 and Formula 2.
[0170] In some embodiments, the hyperparameter set determination module 71 is further used to determine multiple third candidate hyperparameter sets whose model errors satisfy the second preset condition among the multiple second candidate hyperparameter sets; for each third candidate hyperparameter set, determine at least one third target hyperparameter in the third candidate hyperparameter set, and based on the randomly generated second numerical value being less than the mutation probability, change at least one third target hyperparameter in the third candidate hyperparameter set to obtain multiple fourth candidate hyperparameter sets; wherein the mutation probability is determined based on the third minimum error among the model errors corresponding to the multiple third candidate hyperparameter sets, and the model error corresponding to the current third candidate hyperparameter set; the training module 72 is further used to input the exposure information of the source of goods online in the first time period into the initial traffic prediction model corresponding to the fourth candidate hyperparameter set for each fourth candidate hyperparameter set in the multiple fourth candidate hyperparameter sets, and iteratively train the initial traffic prediction model based on the exposure results of the source of goods online in the second time period until the iteration stop condition is met to obtain the fourth candidate traffic prediction model corresponding to the fourth candidate hyperparameter set; model error determination Module 73 is also used to obtain model errors corresponding to the multiple fourth candidate hyperparameter sets based on the exposure prediction results of the supply source launched in the second time period and the actual exposure results of the supply source launched in the second time period respectively according to the multiple fourth candidate traffic prediction models, and perform perturbation operations on the multiple fourth candidate hyperparameter sets to obtain multiple fifth candidate hyperparameter sets; the hyperparameter set determination module 71 is also used to, when there is a fifth candidate hyperparameter set with a model error greater than a third preset threshold among the multiple fifth candidate hyperparameter sets, or when the number of times the fifth candidate hyperparameter set is updated is less than the second preset threshold, return to execute the operations of determining multiple first candidate hyperparameter sets from the multiple fifth candidate hyperparameter sets, updating multiple first candidate hyperparameter sets, updating multiple third candidate hyperparameter sets, and performing perturbation operations on multiple fourth candidate hyperparameter sets for the multiple fifth candidate hyperparameter sets, until the model errors corresponding to the updated multiple fifth candidate hyperparameter sets are all less than or equal to the third preset threshold, and the number of times the multiple fifth candidate hyperparameter sets are updated is greater than or equal to the second preset threshold. The target traffic prediction model determination module 74 is further used to determine the fifth candidate traffic prediction model with the smallest model error among the current multiple fifth candidate hyperparameter sets as the target traffic prediction model.
[0171] In some embodiments, the hyperparameter set determination module 71 is further used to determine the mutation probability corresponding to the third candidate hyperparameter set based on the third minimum error and the model error corresponding to the third candidate hyperparameter set through Formulas 3 and 4.
[0172] In some embodiments, a perturbation operation is performed on multiple fourth candidate hyperparameter sets to obtain multiple fifth candidate hyperparameter sets, including: for each fourth candidate hyperparameter set, based on formula five, perturb the hyperparameters in the fourth candidate hyperparameter set to obtain the corresponding sixth candidate hyperparameter set; for each sixth candidate hyperparameter set, determine the model error corresponding to the sixth candidate hyperparameter set; if the model error of the sixth candidate hyperparameter set is less than the model error corresponding to the corresponding fourth candidate hyperparameter set, determine the sixth candidate hyperparameter set as the fifth candidate hyperparameter set; if the model error of the sixth candidate hyperparameter set is greater than the model error corresponding to the corresponding fourth candidate hyperparameter set, when the randomly generated third numerical value is less than the perturbation probability, determine the sixth candidate hyperparameter set as the fifth candidate hyperparameter set; when the third numerical value is greater than or equal to the perturbation probability, determine the corresponding fourth candidate hyperparameter set as the fifth candidate hyperparameter set.
[0173] In some embodiments, the hyperparameter set determination module 71 is used to determine the perturbation probability through formula six based on the error model corresponding to the sixth candidate hyperparameter set, the model error corresponding to the fourth candidate hyperparameter set, and the number of times the fifth candidate hyperparameter set is currently updated.
[0174] In some embodiments, the hyperparameter set determination module 71 is specifically used to sort the multiple hyperparameter sets in order of model error from small to large, and select the multiple first candidate hyperparameter sets with top rankings from the multiple candidate hyperparameter sets according to a preset ratio; or, cyclically perform the operation of randomly selecting N sixth candidate hyperparameter sets from the multiple hyperparameter sets, and determining the one with the smallest model error among the N sixth candidate hyperparameter sets as the first candidate hyperparameter set, until a stopping condition is reached, and multiple first candidate hyperparameter sets are obtained; N is greater than 1 and less than the number of hyperparameters in the hyperparameter set.
[0175] In some embodiments, the model parameters of the initial traffic prediction model corresponding to the first candidate hyperparameter set, the initial traffic prediction model corresponding to the second candidate hyperparameter set, the fourth candidate hyperparameter set, the fifth candidate hyperparameter set, and the initial traffic prediction model corresponding to the sixth candidate hyperparameter set are all exactly the same.
[0176] An embodiment of the present application provides an electronic device, Figure 8 is a schematic diagram of the structure of an electronic device according to an embodiment of the present application, such as Figure 8As shown, the electronic device 80 includes a memory 801 and a processor 802. The memory 801 stores a computer program that can be run on the processor 802. When the processor 802 executes the program, the steps in the method provided in the above embodiment are implemented.
[0177] It should be noted that the memory 801 is configured to store instructions and applications executable by the processor 802, and can also cache data to be processed or already processed by the processor 802 and various modules in the electronic device 80 (for example, image data, audio data, voice communication data, and video communication data), which can be implemented through flash memory (FLASH) or random access memory 801 (Random Access Memory, RAM).
[0178] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there may be three relationships. For example, object A and / or object B can represent three situations: object A exists alone, object A and object B exist at the same time, and object B exists alone.
[0179] It should be noted that, in this article, the terms "include", "comprises" or any other variations 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 existence of other identical elements in the process, method, article or device including the element.
[0180] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0181] The features disclosed in several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0182] The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0183] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for determining a target flow prediction model, characterized in that: include: Determine multiple first candidate hyperparameter sets from multiple preset hyperparameter sets; wherein, after the initial traffic prediction model corresponding to the first candidate hyperparameter set is trained, the model error of the first candidate traffic prediction model obtained satisfies a first preset condition; the number of hyperparameters in each of the first candidate hyperparameter sets is the same; the multiple first candidate hyperparameter sets include multiple first hyperparameter sets and multiple second hyperparameter sets, and the multiple first hyperparameter sets correspond to the multiple second hyperparameter sets one by one; For each first hyperparameter set and the corresponding second hyperparameter set in the multiple first candidate hyperparameter sets, at least one first target hyperparameter in the first hyperparameter set and at least one second target hyperparameter in the second hyperparameter set are respectively determined, and when the randomly generated first numerical value is less than the crossover probability, the at least one first target hyperparameter in the first hyperparameter set is interchanged with the at least one second target hyperparameter in the second hyperparameter set to obtain multiple second candidate hyperparameter sets; wherein the crossover probability is determined based on a first minimum error in the model errors corresponding to the multiple first candidate hyperparameter sets, and a comparison result of the model error corresponding to the first hyperparameter set and the second minimum error in the model error corresponding to the second hyperparameter set; For each of the second candidate hyperparameter sets, the exposure information of the source of goods online in the first time period is input into the initial traffic prediction model corresponding to the second candidate hyperparameter set, and the initial traffic prediction model corresponding to the second candidate hyperparameter set is iteratively trained based on the exposure results of the source of goods online in the second time period until the iteration stop condition is met, so as to obtain the second candidate traffic prediction model corresponding to the second candidate hyperparameter set; wherein the first time period is before the second time period; Obtaining a model error of the second candidate traffic prediction model corresponding to the second candidate hyperparameter set based on a prediction result of the second candidate traffic prediction model for the exposure information of the source of goods that went online during the input first time period and the exposure result; If, among the multiple second candidate hyperparameter sets, there is a second candidate hyperparameter set whose model error is greater than the first preset threshold, or the number of times the first candidate hyperparameter set is updated is less than the second preset threshold, for the multiple second candidate hyperparameter sets, returning to perform the operations of determining multiple first candidate hyperparameter sets from the multiple second candidate hyperparameter sets and updating the multiple first candidate hyperparameter sets, until the model errors corresponding to the multiple updated second candidate hyperparameter sets are all less than or equal to the first preset threshold, and the number of times the multiple first candidate hyperparameter sets are updated is greater than or equal to the second preset threshold; The second candidate traffic prediction model with the smallest model error among the current multiple second candidate hyperparameter sets is determined as the target traffic prediction model; wherein the target traffic prediction model is used to predict the exposure results of the source of goods going online in the future time period based on the exposure information of the source of goods going online in the historical time period obtained statistically.
2. The method according to claim 1, characterized in that The method further comprises: Based on the first minimum error and the second minimum error, determine the crossover probability by formula 1 or formula 2; Among them, p c is the crossover probability, f min1 is the first minimum error, f1 is the second minimum error, and f min1 -f1 and, represents the comparison result of the first minimum error and the second minimum error, c1 is the preset initial crossover probability; f max1 is the first maximum error among the model errors corresponding to the multiple first candidate hyperparameter sets.
3. The method according to claim 1, characterized in that After obtaining the model error of the second candidate traffic prediction model corresponding to the second candidate hyperparameter set, the method further includes: Determine a plurality of third candidate hyperparameter sets whose model errors satisfy a second preset condition among the plurality of second candidate hyperparameter sets; For each third candidate hyperparameter set, determine at least one third target hyperparameter in the third candidate hyperparameter set, and based on the randomly generated second value being less than the mutation probability, change the at least one third target hyperparameter to obtain multiple fourth candidate hyperparameter sets; wherein the mutation probability is determined based on the third minimum error among the model errors corresponding to the multiple third candidate hyperparameter sets, and a comparison result of the model error corresponding to the current third candidate hyperparameter set; For each fourth candidate hyperparameter set in the plurality of fourth candidate hyperparameter sets, the exposure information of the source of goods online in the first time period is input into the initial traffic prediction model corresponding to the fourth candidate hyperparameter set, and the initial traffic prediction model is iteratively trained based on the exposure result of the source of goods online in the second time period until an iteration stop condition is met, thereby obtaining a fourth candidate traffic prediction model corresponding to the fourth candidate hyperparameter set; Based on the exposure prediction results of the supply launched in the second time period and the actual exposure results of the supply launched in the second time period respectively by the multiple fourth candidate traffic prediction models, obtaining model errors corresponding to the multiple fourth candidate hyperparameter sets respectively; Performing a perturbation operation on the plurality of fourth candidate hyperparameter sets to obtain a plurality of fifth candidate hyperparameter sets; In the case where there is a fifth candidate hyperparameter set whose model error is greater than the third preset threshold value among the multiple fifth candidate hyperparameter sets, or the number of times the fifth candidate hyperparameter set is updated is less than the second preset threshold value, for the multiple fifth candidate hyperparameter sets, returning to execute the operations of determining multiple first candidate hyperparameter sets from the multiple fifth candidate hyperparameter sets, updating multiple first candidate hyperparameter sets, updating multiple third candidate hyperparameter sets, and performing perturbation operations on multiple fourth candidate hyperparameter sets, until the model errors corresponding to the updated multiple fifth candidate hyperparameter sets are all less than or equal to the third preset threshold value, and the number of times the multiple fifth candidate hyperparameter sets are updated is greater than or equal to the second preset threshold value; The fifth candidate traffic prediction model with the smallest model error among the current multiple fifth candidate hyperparameter sets is determined as the target traffic prediction model.
4. The method according to claim 3, characterized in that The method further comprises: Based on the third minimum error and the model error corresponding to the third candidate hyperparameter set, determine the mutation probability corresponding to the third candidate hyperparameter set by formula three or formula four; Among them, p m is the mutation probability, f min2 is the third minimum error, f2 is the model error corresponding to the third candidate hyperparameter set, and c2 is the preset initial mutation probability; max2 is the third maximum error among the model errors corresponding to the plurality of third candidate hyperparameter sets; min2 -f2 and Characterizes a comparison result of the third minimum error and the model error corresponding to the current third candidate hyperparameter set.
5. The method according to claim 3, characterized in that: The performing of the perturbation operation on the plurality of fourth candidate hyperparameter sets to obtain a plurality of fifth candidate hyperparameter sets includes: For each fourth candidate hyperparameter set, based on Formula 5, a perturbation operation is performed on the hyperparameters in the fourth candidate hyperparameter set to obtain a corresponding sixth candidate hyperparameter set: in, is the sixth candidate hyperparameter set, is the corresponding fourth candidate hyperparameter set; r is a vector composed of multiple random numbers, and the multiple random numbers correspond one-to-one to all hyperparameters in the fourth candidate hyperparameter set; T is the second preset threshold, t is the number of times the fifth candidate hyperparameter set is currently updated, i is the sequence number of the fourth candidate hyperparameter set, and j represents the sequence number of the hyperparameter in the fourth candidate hyperparameter set; i is greater than 0 and less than the number of the fourth candidate hyperparameter set; j is greater than 0 and less than or equal to the number of hyperparameters in the fourth candidate hyperparameter set; For each sixth candidate hyperparameter set, determining a model error corresponding to the sixth candidate hyperparameter set, and if the model error of the sixth candidate hyperparameter set is less than the model error corresponding to the corresponding fourth candidate hyperparameter set, determining the sixth candidate hyperparameter set as the fifth candidate hyperparameter set; If the model error of the sixth candidate hyperparameter set is greater than or equal to the model error corresponding to the corresponding fourth candidate hyperparameter set, and when the randomly generated third numerical value is less than the perturbation probability, the sixth candidate hyperparameter set is determined as the fifth candidate hyperparameter set; when the third numerical value is greater than or equal to the perturbation probability, the corresponding fourth candidate hyperparameter set is determined as the fifth candidate hyperparameter set.
6. The method according to claim 5, characterized in that The method further comprises: Based on the error model corresponding to the sixth candidate hyperparameter set, the model error corresponding to the fourth candidate hyperparameter set, and the number of times the fifth candidate hyperparameter set is currently updated, the perturbation probability is determined by Formula 6: P w =e -a×t×[f(t+1)-f(t)] Formula 6; Among them, P w is the perturbation probability, a is a constant, t is the number of times the fifth candidate hyperparameter set is currently updated, f(t+1) is the model error of the sixth candidate hyperparameter set, and f(t) is the model error of the corresponding fourth candidate hyperparameter set.
7. The method according to claim 1, characterized in that The determining of a plurality of first candidate hyperparameter sets from a plurality of preset hyperparameter sets comprises: The multiple hyperparameter sets are sorted in order of model error from small to large, and the multiple first candidate hyperparameter sets with the highest rankings are selected from the multiple candidate hyperparameter sets according to a preset ratio; or, The operation of randomly selecting N sixth candidate hyperparameter sets from the multiple hyperparameter sets and determining one of the N sixth candidate hyperparameter sets with the smallest model error as the first candidate hyperparameter set is executed in a loop until a stopping condition is reached, and multiple first candidate hyperparameter sets are obtained; N is greater than 1 and less than the number of hyperparameters in the hyperparameter set.
8. A device for determining a target flow prediction model, characterized in that: include: A module for executing the method according to any one of claims 1 to 7.
9. An electronic device, characterized in that: include: Memory and processor; The memory is configured to store computer program instructions; The processor is configured to execute the computer program instructions so that the electronic device implements the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: include: Computer program instructions; The electronic device runs the computer program instructions so that the electronic device implements the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Target detection model training method and device, electronic equipment and storage medium
CN115035380A
Hyper-parameter configuration method of time series prediction model
CN115081633A
Cooling capacity prediction model training method and device, cooling capacity prediction method and device and storage medium
CN115511185A
Prediction apparatus using time information, prediction method, prediction program, and recording medium recording the program
JP2009110341A
