Method, device and computer equipment for constructing a time-consuming prediction model for waybill delivery
By constructing a time-consuming prediction model for delivery of waysbills, using the basic waybill data to screen features and eliminate abnormal data, the prediction instability problem caused by the reduction of routing configuration accuracy in the existing technology is solved, and higher prediction accuracy is achieved.
Patent Information
- Application Number
- CN202011352126.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-27
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2040-11-27
AI Technical Summary
The existing time-consuming prediction method for waybill delivery based on routing data is unstable in peak periods such as e-commerce promotions due to the reduced routing configuration accuracy.
By obtaining the basic waybill data of the waybill, analyzing and screening the entry and exit features, eliminating abnormal data, and building a time-consuming prediction model for predicting time-consuming waysbill delivery. This model reduces dependence on routing configuration and improves prediction accuracy.
Improve the accuracy of time-consuming prediction of the waybill delivery, reduce the dependence on routing configuration, and avoid instability caused by routing configuration.
Smart Images

Figure CN114547960B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, computer equipment and storage medium for constructing a time-consuming prediction model for waybill delivery. Background Art
[0002] In recent years, with the vigorous development of logistics and express delivery business, the volume of express delivery has increased rapidly, and the competition in the industry has become increasingly fierce. Therefore, how to improve customer experience has become an important business indicator for all companies. For example, in order to improve customer favorability and enhance customer experience, most companies will predict the time it takes for a waybill to be delivered at the receiving end, transit link, and delivery end in advance to inform customers of the estimated delivery time of the waybill in advance. Most of the existing time-consuming prediction methods use standard routing configurations to calculate the transportation time and the time spent passing through the outlets to obtain the total time of the waybill to determine the delivery time.
[0003] However, the accuracy of existing methods based on route data prediction depends on the strength of the route planning of the waybill. In addition, due to various factors, waybills in real logistics scenarios may not necessarily flow according to the planned routes. Especially during peak logistics periods such as e-commerce promotions, the addition of a large number of temporary transfer stations greatly reduces the accuracy of route configuration, resulting in great instability in time-consuming methods that rely on route configuration prediction, thereby reducing the accuracy of the prediction. Summary of the invention
[0004] Based on this, it is necessary to provide a method, device, computer equipment and storage medium for constructing a waybill delivery time consumption prediction model that can improve the accuracy of time consumption prediction in response to the above technical problems.
[0005] A method for constructing a time-consuming prediction model for waybill delivery, the method comprising:
[0006] Obtaining the waybill basic data of the waybill; the waybill basic data is the data before the waybill is circulated;
[0007] Analyze each waybill feature in the waybill basic data, screen the input features, and obtain the waybill basic data corresponding to the input features as the input waybill basic data;
[0008] Perform abnormal data processing on the basic waybill data input into the model, remove the abnormal data, and obtain the basic waybill data for training;
[0009] A waybill delivery time consumption prediction model for predicting the time consumption is constructed based on the training waybill basic data.
[0010] In one embodiment, analyzing each waybill feature in the waybill basic data, screening the input features, and obtaining the waybill basic data corresponding to the input features as the input waybill basic data includes:
[0011] Based on the average time consumption of each of the waybill features in the waybill basic data, variance analysis is performed on each of the waybill features in the waybill basic data to obtain pre-selected model features;
[0012] Performing secondary screening on the pre-selected model features based on random forest to obtain model features;
[0013] The waybill basic data corresponding to the input mold feature is obtained as the input mold waybill basic data.
[0014] In one embodiment, based on the average time consumption of each of the waybill features in the waybill basic data, performing variance analysis on each of the waybill features in the waybill basic data to obtain pre-selected model features includes:
[0015] According to the average time consumption of each of the waybill features, the inter-group difference and the intra-group difference of each of the waybill features are calculated respectively;
[0016] Determine the ratio of the inter-group difference to the intra-group difference corresponding to each waybill feature, and determine the goodness of fit of each waybill feature according to the inter-group difference and the intra-group difference;
[0017] The features whose ratio and goodness of fit simultaneously satisfy the preset ratio threshold and the preset goodness of fit threshold are selected from the waybill features to obtain pre-selected model features.
[0018] In one embodiment, the secondary screening of the pre-selected model features based on random forest to obtain the model features includes:
[0019] Calculate the first out-of-bag data error and the second out-of-bag data error of each of the pre-selected mold features respectively;
[0020] Determining the feature importance of the pre-selected input features respectively according to the first out-of-bag data error and the second out-of-bag data error;
[0021] Calculating a feature importance coefficient of the pre-selected model feature according to the feature importance and the goodness of fit corresponding to the pre-selected model feature;
[0022] The features whose feature importance coefficients satisfy a preset coefficient threshold are selected from the pre-selected features to obtain the features to be molded.
[0023] In one embodiment, the step of performing abnormal data processing on the input waybill basic data, removing abnormal data, and obtaining training waybill basic data includes:
[0024] Determine, from the basic waybill data entered into the model, waybill features whose feature category quantity is greater than a quantity threshold;
[0025] Determine, based on the feature importance coefficients of the waybill features whose feature categories are greater than the quantity threshold, the feature unimportant coefficients of the waybill features whose feature categories are greater than the quantity threshold;
[0026] Calculate the waybill quantity quantile of each feature category corresponding to the waybill features whose feature category quantity is greater than the quantity threshold;
[0027] After balancing the unimportant coefficients of the features, comparing them with the waybill quantity quantiles corresponding to each of the feature categories;
[0028] The basic waybill data for model entry corresponding to the feature category whose waybill quantity quantile is less than or equal to the unimportant coefficient of the balanced feature is eliminated to obtain the basic waybill data for training.
[0029] In one embodiment, the step of performing abnormal data processing on the input waybill basic data, removing abnormal data, and obtaining training waybill basic data includes:
[0030] Input the basic data of the waybill corresponding to the same waybill into the time consumption prediction model trained with the routing data, and obtain the predicted time consumption corresponding to each waybill;
[0031] Compare the actual time consumption of each waybill with the predicted time consumption respectively to determine the error time consumption of each waybill;
[0032] The basic waybill data for modeling whose error time is a positive number and whose error time is above a preset quantile are eliminated to obtain the basic waybill data for training.
[0033] In one embodiment, the constructing of a waybill delivery time prediction model for predicting the time consumption based on the training waybill basic data includes:
[0034] Constructing a multiple linear regression model according to the input features;
[0035] Sorting and mapping the actual time consumption of each waybill in the training waybill basic data to obtain the waybill time consumption sequence of each waybill, and the sequence-time consumption mapping set of the waybill time consumption sequence and the actual time consumption;
[0036] According to the training waybill basic data, the multiple linear regression model is trained with the time-consuming order of the waybill as the target to obtain a time-consuming order prediction model;
[0037] The time-consuming order prediction model and the order-time-consuming mapping set are combined to obtain a waybill delivery time-consuming prediction model.
[0038] In one embodiment, after constructing a waybill delivery time consumption prediction model for predicting the time consumption according to the training waybill basic data, the method further includes:
[0039] When receiving a prediction request carrying basic data of a predicted waybill, calling the waybill delivery time prediction model;
[0040] Inputting the predicted waybill basic data into a time-consuming order prediction model in the waybill dispatching time-consuming prediction model, and having the time-consuming order prediction model output the time-consuming order of the predicted waybill basic data;
[0041] According to the time consumption order, the predicted time consumption of the predicted waybill basic data is obtained by mapping from the order-time consumption mapping set in the waybill delivery time consumption prediction model.
[0042] A device for constructing a time-consuming prediction model for waybill delivery, the device comprising:
[0043] An acquisition module, used to acquire the waybill basic data of the waybill; the waybill basic data is the data before the waybill is circulated;
[0044] A feature screening module is used to analyze each waybill feature in the waybill basic data, screen the input features, and obtain the waybill basic data corresponding to the input features as the input waybill basic data;
[0045] A data screening module is used to process abnormal data on the basic data of the waybill input into the model, remove abnormal data, and obtain basic data of the training waybill;
[0046] The training module is used to construct a waybill delivery time consumption prediction model for predicting the time consumption based on the training waybill basic data.
[0047] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method for constructing a time-consuming prediction model for waybill delivery are implemented as described in any one of the above items.
[0048] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method for constructing a time-consuming prediction model for waybill delivery as described in any of the above items.
[0049] The method, device, computer equipment and storage medium for constructing the time-consuming prediction model for dispatching a waybill described above, after obtaining the waybill basic data of the waybill, screen the input features by analyzing each waybill feature in the waybill basic data, thereby obtaining the waybill basic data corresponding to the input features as the input waybill basic data; then, abnormal data processing is performed on the input waybill basic data, and abnormal data is eliminated. After obtaining the training waybill basic data, a waybill dispatch time-consuming prediction model for predicting the time consumption is constructed based on the training waybill basic data. Since the waybill basic data is the data before the waybill circulates, the waybill basic data is irrelevant to the routing configuration, so that when predicting the time consumption using the waybill dispatch time-consuming prediction model trained based on the waybill basic data, the dependence on the routing configuration can be reduced, thereby avoiding the instability caused by the routing configuration and improving the accuracy of the time consumption prediction. At the same time, the training waybill basic data is obtained by analyzing and screening the waybill basic data and processing the abnormalities, which can reduce the impact of useless or abnormal data on the model accuracy, thereby improving the model accuracy to improve the accuracy of the time consumption prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 This is an application environment diagram of a method for constructing a time-consuming prediction model for waybill delivery in one embodiment;
[0051] Figure 2 The figure is a flow chart of a method for constructing a time-consuming prediction model for waybill delivery in one embodiment;
[0052] Figure 3 A flowchart of the steps of analyzing each waybill feature in the waybill basic data, screening the features to be entered into a model, and obtaining the waybill basic data corresponding to the features to be entered into the model as the waybill basic data to be entered into the model in one embodiment;
[0053] Figure 4 It is a structural block diagram of a device for constructing a time-consuming prediction model for waybill delivery in one embodiment;
[0054] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0056] The method for constructing a time-consuming prediction model for shipping orders provided in this application can be applied to Figure 1In the application environment shown in the figure, the terminal 102 communicates with the server 104 through the network. After the terminal 102 obtains the basic data of the waybill, the terminal can independently implement the method for constructing the time-consuming prediction model for the waybill delivery. Alternatively, the terminal 102 can send the basic data of the waybill to the server 104, and the server 104 can implement the method for constructing the time-consuming prediction model for the waybill delivery.
[0057] Specifically, taking server 104 as an example, server 104 obtains the waybill basic data of the waybill, which is the data before the waybill is circulated; server 104 analyzes each waybill feature in the waybill basic data, screens the model input features, and obtains the waybill basic data corresponding to the model input features as the model input waybill basic data; server 104 processes the abnormal data of the model input waybill basic data, removes the abnormal data, and obtains the training waybill basic data; server 104 constructs a waybill dispatch time consumption prediction model for predicting the time consumption according to the training waybill basic data. Among them, terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and server 104 can be implemented by an independent server or a server cluster composed of multiple servers.
[0058] In one embodiment, Figure 2 As shown in the figure, a method for constructing a time-consuming prediction model for shipping orders is provided. Figure 1 The server in the example is used to illustrate the following steps:
[0059] Step S202, obtaining the waybill basic data of the waybill; the waybill basic data is the data before the waybill is circulated.
[0060] Among them, the basic data of the waybill is the data before the waybill is circulated, which can be understood as the data that the waybill already has before it is issued at the bulk cargo transfer station, that is, the basic data of the waybill does not include data related to the route. The basic data of the waybill mainly includes data in four dimensions, namely, the sender information of the waybill, the recipient information of the waybill, the bulk cargo transfer station information of the waybill, and the consignment information of the waybill.
[0061] The information on the shipping end of the waybill generally includes the shipping outlet, shipping date, sender's phone number, monthly settlement account, etc. The information on the receiving end of the waybill generally includes the recipient information of the waybill, the delivery address, and the delivery unit area, delivery AOI, and delivery outlet information matched by the delivery address. The bulk cargo transfer yard information of the waybill generally includes the real-time or predicted departure time of the bulk cargo transfer yard of the waybill, etc. The consignment information of the waybill generally includes the consignment category, timeliness type, weight, quantity, etc. of the waybill.
[0062] Specifically, after the terminal receives the basic waybill data uploaded by the user, it sends the basic waybill data to the server.
[0063] Step S204, analyzing each waybill feature in the waybill basic data, screening the features to be entered into the model, and obtaining the waybill basic data corresponding to the features to be entered into the model as the waybill basic data to be entered into the model.
[0064] Among them, waybill features refer to the indicators included in the waybill basic data, such as the shipping outlet, shipping date, sender's phone number, monthly settlement account, recipient information, delivery address, and the delivery unit area matched by the delivery address, delivery AOI (area), delivery outlet information, bulk cargo transfer yard real-time or predicted departure time, consignment category, timeliness type, weight, quantity, etc. The input model feature refers to the indicator selected from the waybill features to build a waybill delivery time prediction model, and the waybill basic data corresponding to the input model feature is the specific data information of each indicator. For example, assuming that the input model feature is the sender's phone number, the corresponding waybill basic data is the specific phone number.
[0065] Specifically, since there are many waybill features in the waybill basic data, in order to prevent the overfitting of the model, and the waybill features may also contain features that are not suitable for constructing a waybill dispatch time consumption prediction model. Therefore, in order to avoid the adverse effects of these waybill features that are not suitable for entering the model on the constructed waybill dispatch time consumption prediction model, it is necessary to screen the waybill features and remove some of the features that are not suitable for entering the model. Mainly by performing feature analysis on each waybill feature, the waybill features that are not suitable for entering the model are screened out according to the results of the analysis, and the modeling features that are suitable for constructing a waybill dispatch time consumption prediction model are obtained. After the modeling features are screened, the waybill basic data corresponding to these modeling features are obtained accordingly to obtain the modeling basic waybill data.
[0066] Step S206, performing abnormal data processing on the basic data of the waybill input into the model, removing the abnormal data, and obtaining the basic data of the training waybill.
[0067] The training waybill basic data is the waybill basic data obtained after the input waybill basic data has been processed for exceptions, and the training waybill basic data is used to train the model.
[0068] Specifically, since there may be redundant or abnormal data in the basic data of the waybill that is screened for model entry, in order to improve the accuracy of the model, the basic data of the waybill that is screened for model entry is analyzed and processed for abnormal data, and the abnormal data in the basic data of the waybill that is screened for model entry is removed to obtain the basic data of the training waybill. For example, data with a small amount of waybill can be removed.
[0069] Step S208, constructing a waybill delivery time consumption prediction model for predicting the time consumption based on the training waybill basic data.
[0070] Specifically, after the training waybill basic data is obtained through multiple screenings, the training waybill basic data can be used to construct the corresponding waybill delivery time consumption prediction model. In this embodiment, the waybill delivery time consumption prediction model is preferably a multiple linear regression model. That is, firstly, a multiple linear regression model is constructed according to the selected input model features. Then, the training waybill basic data is used as input, and the actual time consumption of each waybill in the training waybill basic data is used as the target to train the multiple linear regression model constructed with the input model features, so as to obtain a trained waybill delivery time consumption prediction model.
[0071] The method for constructing the time-consuming prediction model for the waybill delivery mentioned above, after obtaining the waybill basic data of the waybill, screens the model input features by analyzing each waybill feature in the waybill basic data, thereby obtaining the waybill basic data corresponding to the model input features as the waybill basic data for the model input; then, abnormal data processing is performed on the waybill basic data for the model input, and abnormal data is eliminated. After obtaining the training waybill basic data, a waybill delivery time-consuming prediction model for predicting the time consumption is constructed based on the training waybill basic data. Since the waybill basic data is the data before the waybill is circulated, the waybill basic data is irrelevant to the routing configuration, so that when predicting the time consumption using the waybill delivery time-consuming prediction model trained based on the waybill basic data, the dependence on the routing configuration can be reduced, thereby avoiding the instability caused by the routing configuration and improving the accuracy of the time consumption prediction. At the same time, the training waybill basic data is obtained by analyzing and screening the waybill basic data and processing the abnormalities, which can reduce the impact of useless or abnormal data on the model accuracy, thereby improving the model accuracy to improve the accuracy of the time consumption prediction.
[0072] In one embodiment, Figure 3 As shown, step S204 includes:
[0073] Step S302: Based on the average time consumption of each waybill feature in the waybill basic data, variance analysis is performed on each waybill feature in the waybill basic data to obtain pre-selected model features.
[0074] Among them, variance analysis is also called variance analysis, which is used to test the significance of the difference between the mean values of two or more samples. Pre-selected model features refer to the model features preliminarily determined through variance analysis.
[0075] Specifically, because there are many basic features of the waybill in the waybill basic data, in order to prevent overfitting of the model, it is necessary to screen the waybill features in the waybill basic data. Since the present embodiment is to construct a waybill delivery time consumption prediction model, the present embodiment performs variance analysis on each waybill feature based on the average time consumption of each waybill feature. According to the results of the variance analysis, the waybill features that have a significant impact on the delivery time consumption are retained to obtain the pre-modeled features. In this embodiment, the pre-selected model features retained after the variance analysis include: sender's phone number, monthly account number, recipient's phone number, recipient's delivery outlet, unit area, AOI, waybill product type, consignment category, weight, quantity, and the time period of departure of the waybill from the bulk cargo transfer yard, whether the departure is on the weekend, and other 12 features.
[0076] Step S304, performing secondary screening on the pre-selected input features based on random forest to obtain input features.
[0077] Among them, random forest is a classifier that uses multiple trees to train and predict samples. The input features are the waybill features retained after the pre-selected input features are screened twice by the random forest model.
[0078] Specifically, the importance of each pre-selected model feature is calculated according to the random forest model. Then, a secondary screening is performed according to the importance of each pre-selected model feature to obtain the model feature. The importance of each pre-selected model feature can be compared with the preset importance threshold, and the pre-selected model features greater than the preset importance threshold are retained as model features. The preset importance threshold can be adjusted according to actual conditions. In this embodiment, the model features retained after the secondary screening by the random forest model include: the AOI to which the recipient belongs, the unit area to which the recipient belongs, the delivery point to which the recipient belongs, the departure time of the bulk cargo transfer yard, whether the bulk cargo transfer yard is dispatched on weekends, and the time category of the waybill.
[0079] Step S306, obtaining the waybill basic data corresponding to the input features as the input waybill basic data.
[0080] Specifically, after the input feature is determined, the corresponding waybill basic data of the input feature is obtained from the waybill basic data to obtain the input waybill basic data. That is, the data corresponding to the six features, namely, the AOI to which the consignee belongs, the unit area to which the consignee belongs, the delivery outlet to which the consignee belongs, the departure time of the bulk cargo transfer yard, whether the bulk cargo transfer yard is dispatched on weekends, and the waybill timeliness category, are obtained from the waybill basic data to obtain the input waybill basic data.
[0081] In this embodiment, the waybill features are screened through variance analysis and random forest to obtain the input features, which can remove redundant features and retain the features that affect the delivery time, thereby improving the accuracy of the model.
[0082] In one embodiment, step S302 includes: calculating the inter-group differences and intra-group differences of each waybill feature according to the average time consumed by each waybill feature; determining the ratio of the inter-group differences and intra-group differences corresponding to each waybill feature, and determining the goodness of fit of each waybill feature according to the inter-group differences and intra-group differences; selecting from each waybill feature features whose ratio and goodness of fit simultaneously meet the preset ratio threshold and the preset goodness of fit threshold, to obtain pre-selected model features.
[0083] Specifically, first, based on the average time consumption of the waybill features, the inter-group differences and intra-group differences of the waybill features are calculated. Then, the ratio of the inter-group differences and intra-group differences corresponding to the waybill features is determined, and the goodness of fit of the waybill features is determined based on the inter-group differences and intra-group differences. The calculation formulas for the inter-group differences, intra-group differences, ratios, and goodness of fit are as follows:
[0084]
[0085]
[0086]
[0087]
[0088] Among them, TZ is the waybill feature, SSR TZ is the inter-group difference of the waybill feature TZ, SSE TZ is the intra-group difference of the waybill feature TZ, F is the ratio of the waybill feature TZ, is the goodness of fit of the waybill feature TZ. ij It represents the time consumption of the i-th waybill corresponding to the j-th TZ. is the average shipping time of the jth TZ, is the average time of all samples, c is the number of TZs in the sample, n j is the number of samples corresponding to the jth TZ, and n is the number of all samples. Assuming that the waybill feature TZ is AOI, that is, x ij It represents the time consumption of the i-th waybill corresponding to the j-th AOI. is the average shipping time of the j-th AOI, is the average time consumption of all samples, c is the number of AOIs in the sample, n j is the number of samples corresponding to the jth AOI, and n is the number of all samples.
[0089] Since the larger the F value, the more significant the feature, and the higher the goodness of fit, the more representative the feature is for the model. Therefore, after the F value and goodness of fit of each waybill feature are calculated based on the above calculation formula, the F value of each waybill feature is compared with the preset ratio threshold, and the goodness of fit of each waybill feature is compared with the preset goodness of fit threshold. Through comparison, the waybill features with F values greater than the preset ratio threshold and goodness of fit greater than the preset goodness of fit threshold are retained to obtain the pre-selected model features. Among them, the preset ratio threshold and the preset goodness of fit threshold can be adjusted according to actual conditions. In this embodiment, the preset ratio threshold is preferably the standard F value, and the preset goodness of fit threshold is preferably 0.3.
[0090] In this embodiment, feature screening is performed based on the time-consuming calculation for screening feature F-values and goodness of fit, which can ensure as much as possible that the retained features have a significant impact on the delivery time and the degree of impact is large, thereby improving the accuracy of the model.
[0091] In one embodiment, step S304 includes: respectively calculating the first out-of-bag data error and the second out-of-bag data error of each pre-selected feature; respectively determining the feature importance of the pre-selected feature according to the first out-of-bag data error and the second out-of-bag data error; calculating the feature importance coefficient of the pre-selected feature according to the feature importance and goodness of fit corresponding to the pre-selected feature; and selecting features whose feature importance coefficients meet a preset coefficient threshold from the pre-selected features to obtain the feature.
[0092] The first out-of-bag data error is the out-of-bag data error of the pre-selected model feature on the decision tree, and the second out-of-bag data error is the out-of-bag data error after adding random noise interference.
[0093] Specifically, the first out-of-bag data error of each pre-selected model feature is first calculated, recorded as ERROR1. Then, random noise interference is added to the pre-selected model feature, and the out-of-bag data error is recalculated to obtain the second out-of-bag data error, recorded as ERROR2. Assuming AOI is taken as an example, the first out-of-bag data error of AOI on each decision tree is first calculated, and the second out-of-bag data error is calculated after adding random noise to AOI.
[0094] After the first out-of-bag data error and the second out-of-bag data error are calculated, the importance of the pre-selected model features is calculated according to the first out-of-bag data error and the second out-of-bag data error. The calculation formula of the importance is as follows:
[0095] E=∑(ERROR2-ERROR1) / N
[0096] Wherein, E is the importance calculated by the random forest model, and N is the number of decision trees used by the random forest model. In this embodiment, N=10000 is preferred, and can be adjusted according to actual needs.
[0097] Finally, by combining the goodness of fit of the pre-selected model features and the feature importance in the random forest model, the feature importance coefficient of the pre-selected model features is calculated. The calculation formula of the feature importance coefficient is as follows:
[0098]
[0099] Among them, Importance is the feature importance coefficient, c1 and c2 are the weight coefficients of feature importance and feature goodness of fit calculated by random forest, c1+c2=1, and in this embodiment, c1 and c2 are preferably 0.5, which can be adjusted according to actual conditions. NOR is a zero mean normalization function. After the feature importance coefficient of the pre-selected model feature is calculated, the feature importance coefficient of the pre-selected model feature can be compared with the preset coefficient threshold, and the pre-selected model feature greater than the preset coefficient threshold is determined as the model feature. The preset coefficient threshold can be set according to actual conditions.
[0100] In this embodiment, the features to be included in the model are screened by the goodness of fit of variance analysis and the importance of random forest. The screening is performed by combining statistics and machine learning models, which can improve the accuracy of feature importance assessment, thereby improving the accuracy of screening and ensuring the accuracy of the model.
[0101] In one embodiment, step S206 includes: inputting the basic data of the waybill corresponding to the same waybill into the time consumption prediction model trained with the routing data to obtain the predicted time consumption corresponding to each waybill; comparing the actual time consumption of each waybill with the predicted time consumption to determine the error time consumption of each waybill; eliminating the basic data of the waybill for which the error time consumption is a positive number and the error time consumption is above a preset percentile to obtain the training basic data of the waybill.
[0102] The time consumption prediction model trained with routing data refers to a time consumption prediction model trained with waybill routing data as input and time consumption as a target.
[0103] Specifically, this embodiment adopts the existing time-consuming prediction model trained with routing data, and performs time-consuming prediction on the data belonging to the same waybill in the waybill data, and obtains the predicted time of the waybill output by the time-consuming prediction model trained with routing data. Then, the predicted time is subtracted from the actual time to obtain the error time, and the error time = actual time - predicted time. Considering that the error time is a unilateral distribution, only the error time that is a positive number is eliminated, and the waybill data with an error time above the preset quantile is obtained to obtain the training waybill data. In this embodiment, the preset quantile is preferably the 90th quantile. That is, after obtaining the error time of each waybill respectively, the positive error time is sorted from small to large to obtain an error time sequence. Then, the error time corresponding to the 90th percentile in the time-consuming error sequence is calculated. It is determined that the error time is greater than the error time corresponding to the 90th percentile and the waybill data corresponding to the error time is deleted, and the remaining waybill data for the model is the training waybill data. According to actual model verification, this method in this embodiment increases the model accuracy by about 3%.
[0104] In this embodiment, the time-consuming prediction model trained with routing data is used to eliminate abnormal data, which can avoid the influence of the data that takes too long to process the waybill due to forwarding, return, detention and other problems on the prediction accuracy of the model.
[0105] In another embodiment, step S206 includes: determining, from the basic data of the waybill input into the model, the waybill features whose number of feature categories is greater than the quantity threshold; determining, based on the feature importance coefficients of the waybill features whose number of feature categories is greater than the quantity threshold, the feature unimportant coefficients of the waybill features whose number of feature categories is greater than the quantity threshold; calculating the waybill quantity quantiles of each feature category corresponding to the waybill features whose number of feature categories is greater than the quantity threshold; after balancing the feature unimportant coefficients, comparing them with the waybill quantity quantiles corresponding to each feature category respectively; eliminating the basic data of the waybill input into the model corresponding to the feature categories whose waybill quantity quantiles are less than or equal to the balanced feature unimportant coefficients, to obtain the training waybill basic data.
[0106] Among them, the feature category of the waybill feature refers to all indicators belonging to the waybill feature. Taking the waybill feature as AOI as an example, the feature category of AOI may include three indicators such as AOI1, AOI2 and AOI3. AOI1, AOI2 and AOI3 belong to three different areas. The number of feature categories is the sum of the number of each feature category. Taking AOI1, AOI2 and AOI3 as examples, the number of AOI feature categories is 3. The preferred quantity threshold for this implementation is 1000, which can be adjusted according to actual needs. Since the importance is measured in units of 1, the feature non-importance coefficient = 1-feature importance coefficient.
[0107] Specifically, in the basic data of the waybill input into the model, each input feature may have redundant data. For example, usually about 0.03% of the AOIs have less than 50 waybills per month. The delivery time distribution of these AOIs is scattered and there is no obvious pattern, which has a certain impact on the accuracy of the model. Therefore, this embodiment uses the feature importance coefficient of the feature to set a rejection threshold for features with feature categories exceeding 1000, as follows:
[0108] X=P≤M(1-Importance)
[0109] Among them, X is the feature category to be eliminated, and P is the quantile of the waybill quantity corresponding to the waybill quantity of the feature category. The quantile of the waybill quantity is obtained by sorting the waybill quantity of all feature categories corresponding to the waybill feature from small to large and then calculating the quantile. M is a constant, which can be set according to the actual situation, or it can be used as a hyperparameter of the model to participate in the model accuracy tuning. The setting of M is to balance the problem of relatively small Importance. Through the balance of M, the entire quantile threshold can be controlled within the range of 0.01-0.05 to avoid eliminating too many feature categories. That is, when the quantile of the waybill quantity corresponding to the waybill quantity of the feature category is less than or equal to the feature non-important coefficient after M balancing, the basic waybill data corresponding to the feature category is eliminated to obtain the basic waybill data for training. Taking AOI1, AOI2 and AOI3 as examples, when the quantile of the waybill quantity corresponding to the waybill quantity of AOI2 is less than or equal to the feature non-important coefficient after M balancing, the data related to AOI2 is eliminated from the basic waybill data for entering the model, and the remaining data is used as the basic waybill data for training.
[0110] Based on this, the greater the feature importance, the more feature categories are retained, otherwise the fewer. At the same time, the rejection threshold is set by adaptive methods to more specifically remove outliers of each feature, thereby ensuring the improvement of model accuracy.
[0111] In addition, optionally, after obtaining the training waybill data in this embodiment, the basic training waybill data corresponding to the same waybill can also be input into the time consumption prediction model trained with the routing data to obtain the predicted time consumption corresponding to each waybill; the actual time consumption of each waybill is compared with the predicted time consumption to determine the error time consumption of each waybill; the basic waybill data entered into the model with a positive error time consumption and an error time consumption above the preset percentile is eliminated to obtain the final training waybill basic data. That is, the training waybill data obtained by abnormal processing is subjected to secondary abnormal data processing, and the time consumption prediction model trained with the routing data is used to predict the time consumption of the training waybill data belonging to the same waybill, and the corresponding predicted time consumption is output. Similarly, the predicted time consumption is subtracted from the actual time consumption to obtain the error time consumption, and the error time consumption = actual time consumption - predicted time consumption. Then, only for the error time consumption that is a positive number, the training waybill data with an error time consumption percentile above the 90th percentile is eliminated to obtain the final training waybill data. In this embodiment, multiple screening is performed to ensure the elimination of abnormal values and the accuracy of the model.
[0112] In one embodiment, step S208 includes: constructing a multiple linear regression model based on input features; sorting and mapping the actual time consumption of each waybill in the training waybill basic data to obtain the waybill time consumption order of each waybill, the waybill time consumption order and the order-time consumption mapping set of the actual time consumption; training the multiple linear regression model with the waybill time consumption order as the target based on the training waybill basic data to obtain a time consumption order prediction model; combining the time consumption order prediction model and the order-time consumption mapping set to obtain a waybill delivery time consumption prediction model.
[0113] Specifically, the selected model features include: the AOI to which the recipient belongs (X1), the unit area to which the recipient belongs (X2), the delivery outlet to which the recipient belongs (X3), the departure time of the bulk cargo transfer yard (X4), whether the bulk cargo transfer yard is dispatched on weekends (X5), and the timeliness category of the waybill (X6). The constructed multiple linear regression model can be expressed as:
[0114] Y=a1X1+a2X2+a3X3+a4X4+a5X5+a6X6(a i is the variable coefficient)
[0115] Then, according to the actual time of each waybill in the basic data of each training waybill, the actual time is sorted from short to long, and the sorted order is mapped with the actual time to obtain the waybill time sequence and the order-time mapping set of the actual time. Then, according to the basic data of the training waybill, the multiple linear regression model is trained with the waybill time sequence as the target to obtain the time sequence prediction model. The time sequence prediction model and the order-mapping set are combined as the waybill dispatch time prediction model.
[0116] In this embodiment, the time consumption is obtained by predicting the order and mapping the order, which can eliminate the interference of extreme outliers on the model, thereby improving the prediction effect of the model.
[0117] As shown in the following Table 1, Table 1 compares the model effects of the prediction model of this embodiment and the prediction model trained based on routing data.
[0118] When comparing the model effects of the prediction model A of this embodiment and the prediction model B trained with routing data, because the mean square error and average error can only explain the overall effect of the model, they are easily affected by outliers and cannot evaluate the performance of the model on most waybills. Therefore, this embodiment does not adopt the commonly used mean square error or average error method. Instead, the method of calculating each error quantile is used for comparison, that is, first, the difference between the estimated delivery end time and the actual delivery end time of all waybills in the two models is calculated respectively, and then the error time is sorted, and the 20%, 50%, 60%, and 80% quantiles are taken for comparison. In this way, the prediction effects of the two models on most waybills can be seen more clearly. Referring to Table 1, it can be seen that the effect of the prediction model of this embodiment is significantly better than the prediction model trained based on routing data.
[0119] Table 1
[0120]
[0121]
[0122] In one embodiment, taking the waybill delivery time consumption prediction model including a time consumption sequence prediction model and an order-mapping set as an example, a time consumption prediction method is provided, including: when a prediction request carrying predicted waybill basic data is received, calling the waybill delivery time consumption prediction model; inputting the predicted waybill basic data into the time consumption sequence prediction model in the waybill delivery time consumption prediction model, and the time consumption sequence prediction model outputs the time consumption sequence of the predicted waybill basic data; according to the time consumption sequence, mapping the predicted waybill basic data from the order-time consumption mapping set in the waybill delivery time consumption prediction model to obtain the predicted time.
[0123] Specifically, when a prediction request is received, a delivery time prediction model including a time order prediction model and an order-time mapping set is called in response to the prediction request. Then, the predicted delivery basic data sent with the prediction request is input into the time order prediction model, and the time order prediction model performs order prediction based on the predicted delivery basic data, and outputs the time order of the predicted delivery basic data. Then, the relationship between order and time in the order-time mapping set is used to map the time corresponding to the predicted time order, thereby obtaining the predicted time.
[0124] In addition, when the waybill delivery time consumption prediction model is directly trained with time consumption as the target, the predicted waybill basic data carried by the prediction request can be directly input into the waybill delivery time consumption prediction model for time consumption prediction to obtain the predicted time consumption.
[0125] It should be understood that although Figure 2-3 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-4 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0126] In one embodiment, Figure 4 As shown, a device for constructing a time-consuming prediction model for shipping orders is provided, including: an acquisition module 402, a feature screening module 404, a data screening module 406 and a training module 408, wherein:
[0127] The acquisition module 402 is used to acquire the waybill basic data of the waybill, where the waybill basic data is the data before the waybill is circulated.
[0128] The feature screening module 404 is used to analyze the features of each waybill in the waybill basic data, screen the features to be entered into the model, and obtain the waybill basic data corresponding to the features to be entered into the model as the waybill basic data to be entered into the model.
[0129] The data screening module 406 is used to process abnormal data on the basic data of the waybill input into the model, remove the abnormal data, and obtain the basic data of the training waybill.
[0130] The training module 408 is used to construct a waybill delivery time consumption prediction model for predicting the time consumption based on the training waybill basic data.
[0131] In one embodiment, the feature screening module 404 is also used to perform variance analysis on each waybill feature in the waybill basic data based on the average time consumption of each waybill feature in the waybill basic data to obtain pre-selected model features; perform secondary screening on the pre-selected model features based on random forest to obtain model features; and obtain the waybill basic data corresponding to the model features as the model basic data.
[0132] In one embodiment, the feature screening module 404 is also used to calculate the inter-group differences and intra-group differences of each waybill feature based on the average time consumed by each waybill feature; determine the ratio of the inter-group differences and intra-group differences corresponding to each waybill feature, and determine the goodness of fit of each waybill feature based on the inter-group differences and intra-group differences; screen the features whose ratios and goodness of fit satisfy the preset ratio threshold and the preset goodness of fit threshold from each waybill feature, and obtain the pre-selected model features.
[0133] In one embodiment, the feature screening module 404 is also used to respectively calculate the first out-of-bag data error and the second out-of-bag data error of each pre-selected feature; determine the feature importance of the pre-selected feature based on the first out-of-bag data error and the second out-of-bag data error; calculate the feature importance coefficient of the pre-selected feature based on the feature importance and goodness of fit corresponding to the pre-selected feature; and screen the features whose feature importance coefficients meet the preset coefficient threshold from the pre-selected features to obtain the feature.
[0134] In one embodiment, the data screening module 406 is also used to input the basic data of the waybill corresponding to the same waybill into the time consumption prediction model trained with the routing data to obtain the predicted time consumption corresponding to each waybill; compare the actual time consumption of each waybill with the predicted time consumption to determine the error time consumption of each waybill; eliminate the basic data of the waybill for which the error time consumption is a positive number and the error time consumption is above a preset percentile to obtain the training basic data of the waybill.
[0135] In one embodiment, the data screening module 406 is also used to determine the waybill features whose number of feature categories is greater than the quantity threshold from the waybill basic data entering the model; determine the feature unimportant coefficient of the waybill features whose number of feature categories is greater than the quantity threshold based on the feature importance coefficient of the waybill features whose number of feature categories is greater than the quantity threshold; calculate the waybill quantity quantiles of each feature category corresponding to the waybill features whose number of feature categories is greater than the quantity threshold; after balancing the feature unimportant coefficients, compare them with the waybill quantity quantiles corresponding to each feature category respectively; eliminate the waybill basic data entering the model corresponding to the feature categories whose waybill quantity quantiles are less than or equal to the balanced feature unimportant coefficients, and obtain the training waybill basic data.
[0136] In one embodiment, the training module 408 is also used to construct a multiple linear regression model based on the input features; sort and map the actual time consumption of each waybill in the training waybill basic data to obtain the waybill time consumption order of each waybill, the waybill time consumption order and the order-time consumption mapping set of the actual time consumption; train the multiple linear regression model based on the training waybill basic data with the waybill time consumption order as the target to obtain a time consumption order prediction model; combine the time consumption order prediction model and the order-time consumption mapping set to obtain a waybill delivery time consumption prediction model.
[0137] In one embodiment, it also includes a prediction module, which is used to call the waybill delivery time prediction model when receiving a prediction request carrying the predicted waybill basic data; input the predicted waybill basic data into the time consumption sequence prediction model in the waybill delivery time prediction model, and the time consumption sequence prediction model outputs the time consumption sequence of the predicted waybill basic data; according to the time consumption sequence, the predicted time of the predicted waybill basic data is mapped from the order-time consumption mapping set in the waybill delivery time prediction model.
[0138] For the specific limitations on the construction device of the waybill delivery time consumption prediction model, please refer to the limitations on the construction method of the waybill delivery time consumption prediction model mentioned above, which will not be repeated here. Each module in the above-mentioned construction device of the waybill delivery time consumption prediction model can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above-mentioned modules.
[0139] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store basic data of waybills. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for constructing a time-consuming prediction model for waybill delivery is implemented.
[0140] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0141] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0142] Get the basic data of the waybill. The basic data of the waybill is the data before the waybill is circulated.
[0143] Analyze the features of each waybill in the waybill basic data, filter the features to be entered into the model, and obtain the waybill basic data corresponding to the features to be entered into the model as the waybill basic data to be entered into the model;
[0144] Perform abnormal data processing on the basic data of the waybill fed into the model, remove the abnormal data, and obtain the basic data of the training waybill;
[0145] A delivery time prediction model for predicting the delivery time is constructed based on the basic training data of the delivery orders.
[0146] In one embodiment, when the processor executes the computer program, the following steps are also implemented: based on the average time consumption of each waybill feature in the waybill basic data, variance analysis is performed on each waybill feature in the waybill basic data to obtain pre-selected model features; based on random forest, the pre-selected model features are secondary screened to obtain model features; and the waybill basic data corresponding to the model features are obtained as the model-entry waybill basic data.
[0147] In one embodiment, the processor also implements the following steps when executing the computer program: calculate the inter-group differences and intra-group differences of each waybill feature based on the average time consumed by each waybill feature; determine the ratio of the inter-group differences and intra-group differences corresponding to each waybill feature, and determine the goodness of fit of each waybill feature based on the inter-group differences and intra-group differences; select from each waybill feature the features whose ratios and goodness of fit simultaneously meet the preset ratio threshold and the preset goodness of fit threshold, and obtain pre-selected model features.
[0148] In one embodiment, when the processor executes the computer program, the following steps are also implemented: respectively calculating the first out-of-bag data error and the second out-of-bag data error of each pre-selected feature to be entered into the model; respectively determining the feature importance of the pre-selected feature to be entered into the model based on the first out-of-bag data error and the second out-of-bag data error; calculating the feature importance coefficient of the pre-selected feature to be entered into the model based on the feature importance and goodness of fit corresponding to the pre-selected feature to be entered into the model; and selecting features whose feature importance coefficients meet a preset coefficient threshold from the pre-selected features to be entered into the model to obtain the feature to be entered into the model.
[0149] In one embodiment, when the processor executes the computer program, the following steps are also implemented: the basic data of the waybill corresponding to the same waybill is input into the time consumption prediction model trained with the routing data to obtain the predicted time consumption corresponding to each waybill; the actual time consumption of each waybill is compared with the predicted time consumption to determine the error time consumption of each waybill; the basic data of the waybill for input into the model whose error time consumption is a positive number and whose error time consumption is above a preset percentile is eliminated to obtain the training basic data of the waybill.
[0150] In one embodiment, the processor also implements the following steps when executing the computer program: determining the waybill features whose number of feature categories is greater than the quantity threshold from the waybill basic data for input model; determining the feature unimportant coefficients of the waybill features whose number of feature categories is greater than the quantity threshold based on the feature importance coefficients of the waybill features whose number of feature categories is greater than the quantity threshold; calculating the waybill quantity quantiles of each feature category corresponding to the waybill features whose number of feature categories is greater than the quantity threshold; after balancing the feature unimportant coefficients, comparing them with the waybill quantity quantiles corresponding to each feature category respectively; eliminating the waybill basic data for input model corresponding to the feature categories whose waybill quantity quantiles are less than or equal to the balanced feature unimportant coefficients, to obtain the training waybill basic data.
[0151] In one embodiment, the processor also implements the following steps when executing the computer program: constructing a multiple linear regression model based on the input features; sorting and mapping the actual time consumption of each waybill in the training waybill basic data to obtain the waybill time consumption order of each waybill, the waybill time consumption order and the order-time consumption mapping set of the actual time consumption; training the multiple linear regression model with the waybill time consumption order as the target based on the training waybill basic data to obtain a time consumption order prediction model; combining the time consumption order prediction model and the order-time consumption mapping set to obtain a waybill delivery time consumption prediction model.
[0152] In one embodiment, the processor also implements the following steps when executing the computer program: when receiving a prediction request carrying predicted basic data of a waybill, calling a waybill delivery time prediction model; inputting the predicted basic data of the waybill into the time consumption sequence prediction model in the waybill delivery time prediction model, and the time consumption sequence prediction model outputs the time consumption sequence of the predicted basic data of the waybill; according to the time consumption sequence, mapping the predicted time of the basic data of the waybill from the order-time consumption mapping set in the waybill delivery time prediction model to obtain the predicted time.
[0153] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0154] Get the basic data of the waybill. The basic data of the waybill is the data before the waybill is circulated.
[0155] Analyze the features of each waybill in the waybill basic data, filter the features to be entered into the model, and obtain the waybill basic data corresponding to the features to be entered into the model as the waybill basic data to be entered into the model;
[0156] Perform abnormal data processing on the basic data of the waybill fed into the model, remove the abnormal data, and obtain the basic data of the training waybill;
[0157] A delivery time prediction model for predicting the delivery time is constructed based on the basic training data of the delivery orders.
[0158] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: based on the average time consumption of each waybill feature in the waybill basic data, variance analysis is performed on each waybill feature in the waybill basic data to obtain pre-selected model features; based on random forest, the pre-selected model features are secondary screened to obtain model features; and the waybill basic data corresponding to the model features are obtained as the model features.
[0159] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: according to the average time consumption of each waybill feature, the inter-group difference and intra-group difference of each waybill feature are calculated respectively; the ratio of the inter-group difference and intra-group difference corresponding to each waybill feature is determined respectively, and the goodness of fit of each waybill feature is determined respectively according to the inter-group difference and intra-group difference; the features whose ratio and goodness of fit meet the preset ratio threshold and the preset goodness of fit threshold are selected from each waybill feature to obtain the pre-selected model features.
[0160] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: respectively calculating the first out-of-bag data error and the second out-of-bag data error of each pre-selected feature to be entered into the model; respectively determining the feature importance of the pre-selected feature to be entered into the model based on the first out-of-bag data error and the second out-of-bag data error; calculating the feature importance coefficient of the pre-selected feature to be entered into the model based on the feature importance and goodness of fit corresponding to the pre-selected feature to be entered into the model; and selecting features whose feature importance coefficients satisfy a preset coefficient threshold from the pre-selected features to be entered into the model to obtain the feature to be entered into the model.
[0161] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the basic data of the waybill corresponding to the same waybill is input into the time consumption prediction model trained with the routing data to obtain the predicted time consumption corresponding to each waybill; the actual time consumption of each waybill is compared with the predicted time consumption to determine the error time consumption of each waybill; the basic data of the waybill for input into the model whose error time consumption is a positive number and whose error time consumption is above a preset percentile is eliminated to obtain the training basic data of the waybill.
[0162] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: from the basic data of the waybill to be entered into the model, determine the waybill features whose number of feature categories is greater than the quantity threshold; determine the feature unimportant coefficient of the waybill features whose number of feature categories is greater than the quantity threshold based on the feature importance coefficient of the waybill features whose number of feature categories is greater than the quantity threshold; calculate the waybill quantity quantiles of each feature category corresponding to the waybill features whose number of feature categories is greater than the quantity threshold; after balancing the feature unimportant coefficients, compare them with the waybill quantity quantiles corresponding to each feature category respectively; eliminate the basic data of the waybill to be entered into the model corresponding to the feature categories whose waybill quantity quantiles are less than or equal to the balanced feature unimportant coefficients, and obtain the training waybill basic data.
[0163] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: constructing a multiple linear regression model based on the input features; sorting and mapping the actual time consumption of each waybill in the training waybill basic data to obtain the waybill time consumption order of each waybill, the waybill time consumption order and the order-time consumption mapping set of the actual time consumption; training the multiple linear regression model based on the training waybill basic data with the waybill time consumption order as the target to obtain a time consumption order prediction model; combining the time consumption order prediction model and the order-time consumption mapping set to obtain a waybill delivery time consumption prediction model.
[0164] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when a prediction request carrying predicted basic data of a waybill is received, a waybill delivery time prediction model is called; the predicted basic data of the waybill is input into a time sequence prediction model in the waybill delivery time prediction model, and the time sequence prediction model outputs the time sequence of the predicted basic data of the waybill; according to the time sequence, the predicted time of the predicted basic data of the waybill is mapped from the order-time mapping set in the waybill delivery time prediction model.
[0165] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0166] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0167] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for constructing a time-consuming prediction model for waybill delivery, characterized in that: The method comprises: Obtaining the waybill basic data of the waybill; the waybill basic data is the data before the waybill is circulated; Analyze each waybill feature in the waybill basic data, screen the input features, and obtain the waybill basic data corresponding to the input features as the input waybill basic data; Perform abnormal data processing on the basic waybill data input into the model, remove the abnormal data, and obtain the basic waybill data for training; Constructing a multiple linear regression model according to the input features; Sorting and mapping the actual time consumption of each waybill in the training waybill basic data to obtain the waybill time consumption sequence of each waybill, and the sequence-time consumption mapping set of the waybill time consumption sequence and the actual time consumption; According to the training waybill basic data, the multiple linear regression model is trained with the time-consuming order of the waybill as the target to obtain a time-consuming order prediction model; The time-consuming order prediction model and the order-time-consuming mapping set are combined to obtain a waybill delivery time-consuming prediction model.
2. The method according to claim 1, characterized in that The analyzing each waybill feature in the waybill basic data, screening the input features, and obtaining the waybill basic data corresponding to the input features as the input waybill basic data includes: Based on the average time consumption of each of the waybill features in the waybill basic data, variance analysis is performed on each of the waybill features in the waybill basic data to obtain pre-selected model features; Performing secondary screening on the pre-selected model features based on random forest to obtain model features; The waybill basic data corresponding to the input mold feature is obtained as the input mold waybill basic data.
3. The method according to claim 2, characterized in that The average time consumption of each waybill feature in the waybill basic data is based on the variance analysis of each waybill feature in the waybill basic data to obtain pre-selected model features, including: According to the average time consumption of each of the waybill features, the inter-group difference and the intra-group difference of each of the waybill features are calculated respectively; Determine the ratio of the inter-group difference to the intra-group difference corresponding to each waybill feature, and determine the goodness of fit of each waybill feature according to the inter-group difference and the intra-group difference; The features whose ratio and goodness of fit simultaneously satisfy the preset ratio threshold and the preset goodness of fit threshold are selected from the waybill features to obtain pre-selected model features.
4. The method according to claim 3, characterized in that The second screening of the pre-selected model features based on random forest to obtain the model features includes: Calculate the first out-of-bag data error and the second out-of-bag data error of each of the pre-selected mold features respectively; Determining the feature importance of the pre-selected input features respectively according to the first out-of-bag data error and the second out-of-bag data error; Calculating a feature importance coefficient of the pre-selected model feature according to the feature importance and the goodness of fit corresponding to the pre-selected model feature; The features whose feature importance coefficients satisfy a preset coefficient threshold are selected from the pre-selected features to obtain the features to be molded.
5. The method according to claim 1, characterized in that The step of processing the input waybill basic data for abnormal data and removing the abnormal data to obtain the training waybill basic data includes: Determine, from the basic waybill data entered into the model, waybill features whose feature category quantity is greater than a quantity threshold; Determine, based on the feature importance coefficients of the waybill features whose feature categories are greater than the quantity threshold, the feature unimportant coefficients of the waybill features whose feature categories are greater than the quantity threshold; Calculate the waybill quantity quantile of each feature category corresponding to the waybill features whose feature category quantity is greater than the quantity threshold; After balancing the unimportant coefficients of the features, comparing them with the waybill quantity quantiles corresponding to each of the feature categories; The basic waybill data for model entry corresponding to the feature category whose waybill quantity quantile is less than or equal to the unimportant coefficient of the balanced feature is eliminated to obtain the basic waybill data for training.
6. The method according to claim 1, characterized in that The step of processing the input waybill basic data for abnormal data and removing the abnormal data to obtain the training waybill basic data includes: Input the basic data of the waybill corresponding to the same waybill into the time consumption prediction model trained with the routing data, and obtain the predicted time consumption corresponding to each waybill; Compare the actual time consumption of each waybill with the predicted time consumption respectively to determine the error time consumption of each waybill; The basic waybill data for modeling whose error time is a positive number and whose error time is above a preset quantile are eliminated to obtain the basic waybill data for training.
7. The method according to claim 1, characterized in that After the waybill delivery time consumption prediction model for predicting the time consumption is constructed according to the training waybill basic data, the method further includes: When receiving a prediction request carrying basic data of a predicted waybill, calling the waybill delivery time prediction model; Inputting the predicted waybill basic data into a time-consuming order prediction model in the waybill dispatching time-consuming prediction model, and having the time-consuming order prediction model output the time-consuming order of the predicted waybill basic data; According to the time consumption order, the predicted time consumption of the predicted waybill basic data is obtained by mapping from the order-time consumption mapping set in the waybill delivery time consumption prediction model.
8. A device for constructing a time-consuming prediction model for waybill delivery, characterized in that: The device comprises: An acquisition module, used to acquire the waybill basic data of the waybill; the waybill basic data is the data before the waybill is circulated; A feature screening module is used to analyze each waybill feature in the waybill basic data, screen the input features, and obtain the waybill basic data corresponding to the input features as the input waybill basic data; A data screening module is used to process abnormal data on the basic data of the waybill input into the model, remove abnormal data, and obtain basic data of the training waybill; A training module is used to construct a multiple linear regression model based on the input features; sort and map the actual time consumption of each waybill in the training waybill basic data to obtain the waybill time consumption order of each waybill, the waybill time consumption order and the order-time consumption mapping set of the actual time consumption; according to the training waybill basic data, the multiple linear regression model is trained with the waybill time consumption order as the target to obtain a time consumption order prediction model; the time consumption order prediction model and the order-time consumption mapping set are combined to obtain a waybill delivery time consumption prediction model.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Index data analysis method and device of keywords
CN108241643A
A method for calculating the optimal flow velocity in a watershed based on geomorphological parameters
CN109308375A
A logistics pickup operation time consumption intelligent prediction method and system
CN109902858A