Cargo volume prediction method and system combining tensor decomposition and gradient boosting decision tree
Through tensor decomposition, the cargo volume change factor in the logistics network is extracted and integrated into the gradient improvement decision tree model, the problem of insufficient cargo volume prediction accuracy in the logistics network is solved, and the effect of higher prediction accuracy and feature replacement is achieved.
Patent Information
- Application Number
- CN202111499804.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-09
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2041-12-09
AI Technical Summary
The existing shipment forecasting methods in the logistics network have limited historical data for each flow direction, resulting in the prediction effect of machine learning-based shipment forecasting methods that fail to make full use of historical shipment trends.
Tensor decomposition technology is used to extract the cargo volume change factor from the three dimensions of origin transport center, destination transport center and date, and integrate it into the gradient enhancement decision tree model. The factor matrix is constructed through CP decomposition to replace category features to improve predictions Accuracy.
The shipment prediction accuracy of the gradient-enhancing decision tree model is improved. Experiments show that higher prediction accuracy is obtained under the same hyperparameters, and the sample number imbalance caused by high-dimensional category characteristics is avoided.
Smart Images

Figure CN114169611B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cargo volume prediction, and in particular to a cargo volume prediction method and system combining tensor decomposition and gradient boosting decision tree. Background Art
[0002] Cargo volume refers to the weight or number of cargo to be transported every day, and is an important basis for logistics companies' daily operations and management. Transport resources refer to the transportation tools owned by logistics companies, such as trucks, cargo planes, and other resources. Due to the lag in the allocation of transport resources, logistics companies need to predict cargo volume in advance and arrange transport resources based on the predicted cargo volume. Accurate cargo volume forecasting helps to accurately match transport resources and cargo volume, which is of great significance for optimizing cargo transportation timeliness, improving service quality, and reducing operating costs.
[0003] The existing cargo volume forecasting methods mainly include methods based on time series modeling and methods based on machine learning. The cargo volume forecasting method based on time series modeling regards the cargo volume of each flow direction (the cargo transportation path from the origin transshipment center to the destination transshipment center is called the "flow direction" of the cargo) on each operating day in history as a time series, and then combines sequence decomposition and parameter fitting to obtain the internal law of the cargo volume of the time series, and finally predicts the cargo volume of the future time series based on this.
[0004] The machine learning-based method regards cargo volume prediction as a regression problem. By collecting different features of each operation day, such as the origin transshipment center, the destination transshipment center, weather conditions, whether it is a holiday, yesterday's cargo volume, and the actual cargo volume of the day, a model that maps these data features to cargo volume values is trained through these historical data. In order to more accurately learn the mapping relationship between features and cargo volume values and reduce the phenomenon of overfitting, the machine learning-based method requires a large amount of data support. In practical applications, there are many flow directions in the logistics network, but the historical data of each flow direction is limited, which is not enough to support the training of a machine learning model for each flow direction to predict the cargo volume of each flow direction. Therefore, the existing machine learning-based cargo volume prediction method uses the flow direction as a categorical feature to participate in the model training. However, although the machine learning-based cargo volume prediction method can better mine the relationship between data features such as the origin transshipment center, the destination transshipment center, and weather conditions and the cargo volume, it takes the characteristic data of each day of each flow direction as a separate sample and does not consider the impact of historical cargo volume trends on the accuracy of cargo volume prediction, resulting in the prediction effect of the existing machine learning-based cargo volume prediction method is not ideal. Summary of the invention
[0005] The present invention provides a cargo volume prediction method and system combining tensor decomposition with gradient boosting decision tree. By performing CP decomposition on the constructed tensor, cargo volume change factors are extracted from three dimensions: the origin transshipment center, the destination transshipment center, and the date. The cargo volume change factors of the transshipment center dimension are integrated into the gradient boosting decision tree model, thereby better utilizing the historical cargo volume change trend and improving the cargo volume prediction accuracy of the gradient boosting decision tree model.
[0006] To achieve this object, the present invention adopts the following technical solutions:
[0007] A cargo volume prediction method combining tensor decomposition and gradient boosting decision tree is provided, the steps comprising:
[0008] S1, construct a three-dimensional tensor is a set of real numbers, O, D, and T represent the set of origin transit centers, the set of destination transit centers, and the set of dates extracted from the sample set, respectively;
[0009] S2, for the tensor After CP decomposition, the factor matrices on the three dimensions of origin transshipment center, destination transshipment center and date are constructed, which are recorded as A, B, and C respectively. Each row in the factor matrix A, B, and C represents a corresponding cargo volume change factor on the origin transshipment center dimension, destination transshipment center dimension, and date dimension;
[0010] S3, replacing the category feature of the origin transfer center in the acquired feature data X of all flows with the row vector corresponding to the origin transfer center in the factor matrix A, and replacing the category feature of the destination transfer center in the acquired feature data X with the row vector corresponding to the destination transfer center in the factor matrix B, and obtaining new feature data X′ after feature replacement;
[0011] S4, input the feature data X′ into the cargo volume prediction model based on gradient boosting decision tree training, and the model outputs the cargo volume prediction value
[0012] As a preferred solution of the present invention, in step S2, the tensor The method steps for performing CP decomposition and constructing factor matrices A, B, and C include:
[0013] S21, given the tensor The rank R, then for the tensor Perform CP decomposition, the tensor The CP decomposition form of is expressed by the following formula (1):
[0014]
[0015] In formula (1), Respectively represent the factor components on the origin transshipment center dimension, the destination transshipment center dimension, and the date dimension;
[0016] r=1,…,R;
[0017] Indicates the outer product operation on the vector;
[0018] S22, according to the decomposed factor component a r 、b r 、c r , construct the factor matrices A, B, and C of the origin transshipment center dimension, the destination transshipment center dimension, and the date dimension respectively. The factor matrices A, B, and C are expressed as follows:
[0019]
[0020]
[0021]
[0022] As a preferred embodiment of the present invention, 2≤R≤6.
[0023] As a preferred solution of the present invention, the method steps for training the cargo volume prediction model include:
[0024] L1, divide the feature data X of all flows in the historical N days and the actual cargo volume data Y corresponding to X into a training set and a validation set, and the feature data X in the training set and the actual cargo volume data Y corresponding to X are respectively recorded as X train , Y train The feature data X in the validation set and the actual cargo volume data Y corresponding to X are respectively denoted as X valid , Y valid ;
[0025] L2, construct the tensor
[0026] L3, for the tensor After CP decomposition, the factor matrix on the three dimensions of origin transshipment center, destination transshipment center and date is constructed, which are recorded as A, B and C respectively;
[0027] L4, X train The category feature of the origin transit center in is replaced by the row vector corresponding to the origin transit center in the factor matrix A, and X train The category feature of the destination transport center in is replaced by the row vector corresponding to the destination transport center in the factor matrix B, and the new feature data X is obtained.train ′; X valid The category feature of the origin transit center in is replaced by the row vector corresponding to the origin transit center in the factor matrix A, and X valid The category feature of the destination transport center in is replaced by the row vector corresponding to the destination transport center in the factor matrix B, and the new feature data X is obtained. valid ′;
[0028] L5, respectively (X train ′,Y train )、(X valid ′,Y valid ) are the training set and validation set for cargo volume prediction model training, and the cargo volume prediction model is formed by gradient boosting decision tree training.
[0029] As a preferred solution of the present invention, N=800.
[0030] As a preferred solution of the present invention, the feature data X of N′ days in the historical N days and the actual cargo volume data Y corresponding to X are selected as a validation set for verifying the performance of the trained cargo volume prediction model, 0.05N≤N′≤0.1N.
[0031] The present invention also provides a cargo volume prediction system combining tensor decomposition and gradient boosting decision tree, which can implement the cargo volume prediction method. The cargo volume prediction system includes:
[0032] A data extraction module is used to extract the originating transshipment center, the destination transshipment center and the date from the sample set according to the data extraction instruction, and form an originating transshipment center set O, a destination transshipment center set D and a date set T respectively;
[0033] The three-dimensional tensor construction module is connected to the data extraction module and is used to construct a three-dimensional tensor based on the extracted sets O, D, and T with data extraction completion as the instruction.
[0034] A tensor decomposition module is connected to the three-dimensional tensor construction module and is used to perform tensor construction on the tensor as an instruction. Perform CP decomposition to obtain the factor components a corresponding to the origin transshipment center dimension, destination transshipment center dimension, and date dimension r 、b r 、c r
[0035] A factor matrix construction module is connected to the tensor decomposition module and is used to complete the tensor decomposition into instructions according to the decomposed factor components a r 、b r 、c r, construct factor matrices A, B, and C on the three dimensions of origin transshipment center, destination transshipment center, and date. Each row in the factor matrices A, B, and C represents a corresponding cargo volume change factor of the origin transshipment center, destination transshipment center, and date;
[0036] A feature replacement module, connected to the factor matrix construction module, is used to replace the category feature of the originating transit center in the acquired feature data X with the row vector corresponding to the originating transit center in the factor matrix A, and is used to replace the category feature of the destination transit center in the acquired feature data X with the row vector corresponding to the destination transit center in the factor matrix B, and obtain new feature data X′ after feature replacement;
[0037] The cargo volume prediction module is connected to the feature replacement module and is used to input the feature data X′ into the cargo volume prediction model based on gradient boosting decision tree training, and the model outputs the cargo volume prediction value
[0038] As a preferred solution of the present invention, the cargo volume forecasting system further includes:
[0039] The model training module is used to use the feature data X′ and the actual cargo volume data Y corresponding to X′ as model training samples, and to form the cargo volume prediction model based on gradient boosting decision tree training.
[0040] The present invention performs low-rank approximation on the cargo volume tensor through CP decomposition to filter out noise, and extracts cargo volume change factors from three dimensions: the origin transshipment center, the destination transshipment center, and the date. By integrating the cargo volume change factors of the two dimensions of the origin transshipment center and the destination transshipment center into the gradient boosting decision tree model, the historical cargo volume change trend is better utilized, and the cargo volume prediction accuracy of the gradient boosting decision tree model is improved. Experiments show that under the same hyperparameters, the present invention can obtain a higher prediction accuracy than the cargo volume prediction method using only the gradient boosting decision tree. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0042] Figure 1 It is a diagram of the implementation steps of a method for predicting cargo volume by combining tensor decomposition and gradient boosting decision tree provided by one embodiment of the present invention;
[0043] Figure 2It is a step diagram of the method of performing CP decomposition on a tensor and constructing a factor matrix;
[0044] Figure 3 This is a step diagram of a method for training a cargo volume prediction model provided by an embodiment of the present invention;
[0045] Figure 4 It is a structural schematic diagram of a cargo volume prediction system combining tensor decomposition and gradient boosting decision tree provided by an embodiment of the present invention;
[0046] Figure 5 It is a schematic diagram of CP decomposition of a tensor;
[0047] Figure 6 is the constructed tensor An example diagram of
[0048] Figure 7 Here is an example plot of three factor matrices obtained by setting R to 2 and using the alternating least squares method. DETAILED DESCRIPTION
[0049] The technical solution of the present invention is further described below with reference to the accompanying drawings and through specific implementation methods.
[0050] Among them, the drawings are only used for illustrative explanations, and they only represent schematic diagrams rather than actual pictures, and should not be understood as limitations on this patent; in order to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of the actual product; for those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted.
[0051] The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if the terms "upper", "lower", "left", "right", "inner", "outer", etc. appear, the orientation or position relationship indicated is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, the terms describing the position relationship in the drawings are only used for illustrative purposes and cannot be understood as a limitation on this patent. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.
[0052] In the description of the present invention, unless otherwise clearly specified and limited, if the term "connection" or the like appears to indicate the connection relationship between components, the term should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two components or the interaction relationship between two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0053] The logistics network can be viewed as a network consisting of transshipment center nodes and lines connecting different transshipment center nodes. Specifically, the transshipment center is the node where goods are transferred. Each order of goods has an originating transshipment center and a destination transshipment center. Goods are transported from the originating transshipment center to the destination transshipment center, indicating that the "flow direction" of the goods is from the originating transshipment center to the destination transshipment center.
[0054] The operation of the logistics network has a certain cycle. Generally speaking, the span of a cycle is 24 hours, which is called an operation day. On each operation day, a transportation resource dispatch is carried out to deliver the goods arriving on that operation day to the destination transfer center. Since transportation resource dispatch generally needs to be carried out before the end of the operation day, it is still impossible to determine how many goods will arrive on that operation day. Therefore, it is necessary to predict the cargo volume in all directions of the entire network before the end of the operation day, and dispatch the transportation resource for that operation day accordingly. Accurate cargo volume forecasting helps to accurately allocate transportation resources, so that all goods can be transported without leaving transportation resources idle.
[0055] At present, the prediction of cargo volume mostly adopts machine learning methods. However, the historical cargo volume data of each flow direction is very limited, which is not enough to support the training of a machine learning model for each flow direction. Therefore, in the prior art, the flow direction is used as a categorical feature to participate in the training of the cargo volume prediction model. However, since the characteristic data of each flow direction for each day is used as a separate sample in the model training, the impact of the historical cargo volume trend on the accuracy of cargo volume prediction is not considered, resulting in the prediction effect of the existing cargo volume prediction method based on machine learning is not ideal.
[0056] To this end, an embodiment of the present invention provides a cargo volume prediction method that combines tensor decomposition with a gradient boosting decision tree. On the one hand, tensor decomposition is used to extract historical cargo volume change factors from multiple dimensions and integrate them into a cargo volume prediction model based on gradient boosting decision tree training, thereby improving the model's cargo volume prediction accuracy. On the other hand, high-dimensional category features are replaced with numerical features, thereby avoiding the problem of severe imbalance in the number of samples in leaf nodes caused by the one-vs-other node splitting method of the gradient boosting decision tree on high-dimensional category features.
[0057] The specific implementation of the cargo volume prediction method we provide by combining tensor decomposition and gradient boosting decision tree includes the following four steps:
[0058] 1. Data Acquisition and Data Preprocessing
[0059] 1) Original data acquisition
[0060] Before training the cargo volume prediction model, we first need to obtain historical data from the database. We obtain the feature data X of all flows in the past N days and the actual cargo volume data Y corresponding to X from the logistics database. The feature data X includes the weather conditions on the day of the freight, whether it is a holiday, and the feature data of the origin and destination transshipment centers.
[0061] X is a matrix with P rows and F columns. Each row is a sample point, which represents all the features of a certain flow on a certain day (the features include the weather conditions on the day of the freight, whether it is a holiday, the data features of the originating transshipment center and the destination transshipment center, etc.). Each column is a set of feature values, which represents the value of all sample points in this feature. Y is a vector of length P, and each element in the vector represents the actual cargo volume of a certain flow on a certain day in history. A larger N includes more information, which can reduce the phenomenon of model overfitting and improve the generalization ability of the model. Therefore, we prefer N = 800.
[0062] 2) Data preprocessing
[0063] Since the acquired historical feature data X and actual cargo volume data Y may contain missing values or values that are seriously deviated from the actual values, it is necessary to select the zero-filling method or the mean-filling method to fill the missing values according to the characteristics of different features. For outliers that are seriously deviated from the actual values, the outliers can be removed by trimming the outliers or discarding the sample points where the outliers are located. By filling in missing values and processing outliers, high-quality feature data X and actual cargo volume data Y can be obtained.
[0064] 2. Training set and validation set division
[0065] In order to evaluate the quality of the model in time during the training process, the historical feature data X and the actual cargo volume data Y after missing value filling and outlier processing are divided into two parts: training set and validation set. Preferably, we select the historical feature data X and the actual cargo volume data Y of the N'th day closest to the current day in the historical N days as validation data to form a validation set, and the feature data X in the validation set and the actual cargo volume data Y corresponding to X are respectively recorded as X valid , Y valid The remaining NN′ days of data are used as training data to form a training set. The feature data X in the training set and the actual cargo volume data Y corresponding to X are recorded as X train , Ytrain Preferably, 0.05N≤N′≤0.1N.
[0066] 3. Cargo volume prediction model training
[0067] 1) Tensor construction
[0068] First, we extract the four variables of the origin transshipment center, destination transshipment center, date, and daily cargo volume from the sample set (including training set and validation set), and then construct a three-dimensional tensor. is a set of real numbers, O, D, and T represent the set of origin transit centers, the set of destination transit centers, and the set of dates extracted from the sample set, respectively. Elements It represents the quantity of cargo shipped from transshipment center i to transshipment center j on date k.
[0069] See also Figure 6 , tensor An example is: the originating transshipment centers are Hangzhou, Beijing, and Nanjing, the destination transshipment centers are Guangzhou, Shaoxing, and Ningbo, the dates are 2021-10-01, 2021-10-02, and 2021-10-03, and the elements in the cell are the cargo volumes shipped from the corresponding originating transshipment center to the corresponding destination transshipment center on that date.
[0070] 2) Tensor CP decomposition
[0071] Tensor Please refer to the CP decomposition diagram Figure 5 , for the tensor The method for CP decomposition is: given the rank R of the tensor, the tensor is then decomposed using methods including but not limited to alternating least squares, line search or Tikhonvo regularization. Perform CP decomposition, tensor The CP decomposition form of is expressed by the following formula (1):
[0072]
[0073] In formula (1), Respectively represent the factor components on the origin transshipment center dimension, the destination transshipment center dimension, and the date dimension; They are factor matrices on the dimensions of the originating transshipment center, the destination transshipment center, and the date.
[0074] r=1,…,R;
[0075] Represents the outer product operation on vectors.
[0076] Specifically, taking the alternating least squares method as an example, we will introduce how to calculate A, B, and C:
[0077] a) Randomly initialize factor matrices A, B, C and set the error threshold ∈;
[0078] b) Fix B and C and calculate the reconstruction error in For tensors The mode-1 expansion matrix of , ⊙ is the matrix Khatri-Rao product, ‖·‖2 is the 2-norm of the matrix;
[0079] c) If e≤∈, the algorithm terminates, if e>∈, update in is the Moore-Penrose generalized inverse operation of the matrix;
[0080] d) Fix A and C and calculate the reconstruction error in For tensors The mode-2 expansion matrix of , ⊙ is the matrix Khatri-Rao product, ‖·‖2 is the 2-norm of the matrix;
[0081] e) If e≤∈, the algorithm terminates, if e>∈, update in is the Moore-Penrose generalized inverse operation of the matrix;
[0082] f) Fix A and B and calculate the reconstruction error in is the mode-3 expansion matrix of tensor X, ⊙ is the matrix Khatri-Rao product, ‖·‖2 is the 2-norm of the matrix;
[0083] g) If e≤∈, the algorithm terminates, if e>∈, update in is the Moore-Penrose generalized inverse operation of the matrix;
[0084] h) Return to step b)
[0085] This unit will tensor Decompose into three factor matrices. In practice, a smaller R is generally selected to extract Key potential characteristics on origin transshipment center, destination transshipment center and date. Figure 7 The three factor matrices obtained by setting R to 2 and using the alternating least squares method are shown.
[0086] 3) Feature replacement
[0087] X trainThe category feature of the origin transit center in the factor matrix A is replaced by the row vector corresponding to the origin transit center (for example, Figure 7 The row vector [30,40] in the factor matrix A in replaces the category feature of the originating transshipment center "Hangzhou", and X train The category feature of the destination transfer center in the factor matrix B is replaced by the row vector corresponding to the destination transfer center, and the new feature data X is obtained. train ′;
[0088] X valid The category feature of the origin transit center in is replaced by the row vector corresponding to the origin transit center in the factor matrix A, and X valid The category feature of the destination transfer center in the factor matrix B is replaced by the row vector corresponding to the destination transfer center, and the new feature data X is obtained. valid ′.
[0089] 4) Cargo volume forecasting model training and model optimization
[0090] Using different R and model training parameters, with new training data (X train ′,Y train ) is the model training sample, and the cargo volume prediction model is trained using the gradient boosting decision tree to obtain several cargo volume prediction models. valid ′,Y valid ) is taken as the optimal model.
[0091] IV. Model Application
[0092] The cargo volume is predicted by selecting the optimal model. The prediction method is as follows:
[0093] First, the feature data of the day is obtained, and then the category feature of the origin transshipment center in the feature data of the day is replaced with the row vector corresponding to the origin transshipment center in the factor matrix A, and the category feature of the destination transshipment center in the feature data of the day is replaced with the row vector corresponding to the destination transshipment center in the factor matrix B to obtain new feature data. Finally, the obtained new feature data is input into the optimal model, and the model outputs the cargo volume prediction result.
[0094] In summary, the embodiment of the present invention provides a cargo volume prediction method combining tensor decomposition and gradient boosting decision tree, such as Figure 1 As shown, including:
[0095] Step S1, construct a three-dimensional tensor is a set of real numbers, O, D, and T represent the set of origin transit centers, the set of destination transit centers, and the set of dates extracted from the sample set, respectively;
[0096] Step S2, after CP decomposition of the tensor x, construct factor matrices on the three dimensions of the origin transshipment center, the destination transshipment center, and the date, which are denoted as A, B, and C respectively. Each row in the factor matrix A, B, and C represents a corresponding cargo volume change factor on the origin transshipment center dimension, the destination transshipment center dimension, and the date dimension;
[0097] Step S3, replacing the category feature of the origin transfer center in the acquired feature data X of all flows with the row vector corresponding to the origin transfer center in the factor matrix A, and replacing the category feature of the destination transfer center in the acquired feature data X with the row vector corresponding to the destination transfer center in the factor matrix B, and obtaining new feature data X′ after feature replacement;
[0098] Step S4: input the feature data X′ into the cargo volume prediction model based on gradient boosting decision tree training, and the model outputs the cargo volume prediction value
[0099] In step S2, the tensor The method steps for performing CP decomposition and constructing factor matrices A, B, and C include:
[0100] Step S21, given tensor The rank R of the tensor is then used to perform alternating least squares on the Perform CP decomposition to obtain factor components a on the origin transshipment center dimension, destination transshipment center dimension, and date dimension r 、b r 、c r , tensor The CP decomposition form of is expressed by the above formula (1);
[0101] Step S22, according to the decomposed factor component a r 、b r 、c r , construct the factor matrices A, B, and C of the origin transshipment center dimension, the destination transshipment center dimension, and the date dimension respectively. The factor matrices A, B, and C are expressed as follows:
[0102]
[0103]
[0104]
[0105] like Figure 3 As shown, the method for training the cargo volume prediction model specifically includes:
[0106] Step L1: divide the feature data X of all flows in the history of N days and the actual cargo volume data Y corresponding to X into a training set and a validation set. The feature data X in the training set and the actual cargo volume data Y corresponding to X are respectively recorded as X train , Y train , the feature data X in the validation set and the actual cargo volume data Y corresponding to X are respectively recorded as X valid , Y valid ;
[0107] Step L2, build tensor
[0108] L3, tensor of tensors After CP decomposition, the factor matrix on the three dimensions of origin transshipment center, destination transshipment center and date is constructed, which are recorded as A, B and C respectively;
[0109] L4, X train The category feature of the origin transit center in is replaced by the row vector corresponding to the origin transit center in the factor matrix A, and X train The category feature of the destination transport center in is replaced by the row vector corresponding to the destination transport center in the factor matrix B, and the new feature data X is obtained. train ′; X valid The category feature of the origin transit center in is replaced by the row vector corresponding to the origin transit center in the factor matrix A, and X valid The category feature of the destination transport center in is replaced by the row vector corresponding to the destination transport center in the factor matrix B, and the new feature data X is obtained. valid ′;
[0110] L5, respectively (X train ′,Y train )、(X valid ′,Y valid ) are the training set and validation set for the cargo volume prediction model, and the cargo volume prediction model is formed by gradient boosting decision tree training.
[0111] The present invention also provides a cargo volume prediction system combining tensor decomposition and gradient boosting decision tree, which can implement the cargo volume prediction method, such as Figure 4 As shown, the cargo volume forecasting system includes:
[0112] A data extraction module is used to extract the originating transshipment center, the destination transshipment center and the date from the sample set according to the data extraction instruction, and form an originating transshipment center set O, a destination transshipment center set D and a date set T respectively;
[0113] The three-dimensional tensor construction module is connected to the data extraction module and is used to construct a three-dimensional tensor based on the extracted sets O, D, and T with data extraction completion as the instruction.
[0114] The tensor decomposition module is connected to the three-dimensional tensor construction module, which is used to complete the tensor construction as an instruction to decompose the tensor. Perform CP decomposition to obtain the factor components a corresponding to the origin transshipment center dimension, destination transshipment center dimension, and date dimension r , b r 、c r
[0115] The factor matrix building module is connected to the tensor decomposition module to complete the tensor decomposition as an instruction, according to the factor component a r , b r 、c r , construct factor matrices A, B, and C on the three dimensions of origin transshipment center, destination transshipment center, and date. Each row in the factor matrices A, B, and C represents a corresponding cargo volume change factor of the origin transshipment center, destination transshipment center, and date;
[0116] A feature replacement module, connected to the factor matrix construction module, is used to replace the category feature of the originating transshipment center in the acquired feature data X with the row vector corresponding to the originating transshipment center in the factor matrix A, and is used to replace the category feature of the destination transshipment center in the acquired feature data X with the row vector corresponding to the destination transshipment center in the factor matrix B, and obtain new feature data X′ after feature replacement;
[0117] The cargo volume prediction module is connected to the feature replacement module, which is used to input the feature data X′ into the cargo volume prediction model based on gradient boosting decision tree training, and the model outputs the cargo volume prediction value
[0118] Preferably, the cargo volume forecasting system further includes:
[0119] A model training module is used to use the feature data X′ and the actual cargo volume data Y corresponding to X′ as model training samples, and to form the cargo volume prediction model based on gradient boosting decision tree training.
[0120] In summary, the present invention performs low-rank approximation on the cargo volume tensor through CP decomposition to filter out noise, and extracts cargo volume change factors from the three dimensions of the origin transshipment center, the destination transshipment center and the date, and integrates the cargo volume change factors of the two dimensions of the origin transshipment center and the destination transshipment center into the gradient boosting decision tree model, thereby better utilizing the historical cargo volume change trend and improving the cargo volume prediction accuracy of the gradient boosting decision tree model. Experiments show that under the same hyperparameters, the present invention can obtain a higher prediction accuracy than the cargo volume prediction method using only the gradient boosting decision tree.
[0121] In addition, the present invention avoids the problem of severe imbalance in the number of samples on leaf nodes caused by the one-vs-other node splitting method of the gradient boosting decision tree on high-dimensional category features by replacing the high-dimensional category features of the samples with numerical features.
[0122] It should be noted that the above specific implementations are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art should understand that various modifications, equivalent substitutions, changes, etc. can be made to the present invention. However, as long as these changes do not deviate from the spirit of the present invention, they should be within the scope of protection of the present invention. In addition, some terms used in the specification and claims of this application are not restrictive, but are only for the convenience of description.
Claims
1. A cargo volume prediction method combining tensor decomposition and gradient boosting decision tree, characterized in that the steps include: S1, extract the four variables of the origin transshipment center, destination transshipment center, date and volume of cargo on that day from the sample set, and then construct a three-dimensional tensor , , is the set of real numbers, Respectively represent the set of origin transit centers, the set of destination transit centers, and the set of dates extracted from the sample set. The three-dimensional tensor Elements Indicates on date From the Transit Center Send to transshipment center The volume value of goods; S2, for the tensor After CP decomposition, factor matrices on the three dimensions of origin transshipment center, destination transshipment center and date are constructed and recorded as , the factor matrix Each row in represents a corresponding cargo volume change factor in the dimensions of the origin transshipment center, the destination transshipment center, and the date; S3, obtains the characteristic data of all flows The category feature of the origin transit center in is replaced by the factor matrix The row vector corresponding to the originating transit center in The category feature of the destination transit center in is replaced by the factor matrix The row vector corresponding to the destination transfer center in the image is replaced by new feature data. ; S4, the feature data Input into the cargo volume prediction model based on gradient boosting decision tree training, and the model outputs the cargo volume prediction value .
2. The cargo volume prediction method combining tensor decomposition and gradient boosting decision tree according to claim 1 is characterized in that: In step S2, the tensor Perform CP decomposition and construct factor matrix The method steps include: S21, given the tensor Rank , then for the tensor Perform CP decomposition, the tensor The CP decomposition form of is expressed by the following formula (1): In formula (1), , , , respectively represent the factor components on the origin transshipment center dimension, the destination transshipment center dimension and the date dimension; ; " " means to perform outer product operation on vectors; S22, according to the decomposed factor components , construct the factor matrices of the origin transshipment center dimension, the destination transshipment center dimension, and the date dimension respectively , the factor matrix They are expressed as follows:
3. The cargo volume prediction method combining tensor decomposition and gradient boosting decision tree according to claim 2 is characterized in that: 。 4. The cargo volume prediction method combining tensor decomposition and gradient boosting decision tree according to claim 1 is characterized in that: The method steps for training the cargo volume prediction model include: L1, history The characteristic data of all flows in the day as well as Corresponding actual cargo volume data Divided into a training set and a validation set, the feature data in the training set as well as The corresponding actual cargo volume data Denoted as , the feature data in the validation set as well as The corresponding actual cargo volume data Denoted as ; L2, construct the tensor ; L3, for the tensor After CP decomposition, factor matrices on the three dimensions of origin transshipment center, destination transshipment center and date are constructed and recorded as ; L4, The category feature of the origin transit center in is replaced by the factor matrix The row vector corresponding to the originating transfer center in The category feature of the destination transit center in is replaced by the factor matrix The row vector corresponding to the destination transfer center in the image is used to obtain the new feature data. ;Will The category feature of the origin transit center in is replaced by the factor matrix The row vector corresponding to the originating transfer center in The category feature of the destination transit center in is replaced by the factor matrix The row vector corresponding to the destination transfer center in the image is used to obtain the new feature data. ; L5, respectively , The training set and validation set are used for training the cargo volume prediction model, and the cargo volume prediction model is formed by using gradient boosting decision tree training.
5. The cargo volume prediction method combining tensor decomposition and gradient boosting decision tree according to claim 4 is characterized in that: N=800。 6. The cargo volume prediction method combining tensor decomposition and gradient boosting decision tree according to claim 4 or 5, characterized in that: Selection History Tianzhong The characteristic data of the day as well as Corresponding actual cargo volume data As a validation set for verifying the performance of the trained cargo volume prediction model, .
7. A cargo volume forecasting system combining tensor decomposition and gradient boosting decision tree, which can implement the cargo volume forecasting method according to any one of claims 1 to 6, characterized in that: The cargo volume forecasting system comprises: The data extraction module is used to extract the four variables of the origin transshipment center, the destination transshipment center, the date, and the cargo volume on that day from the sample set according to the data extraction instruction, and form the origin transshipment center set respectively. , Destination transfer center collection and date collection ; The three-dimensional tensor building module is connected to the data extraction module and is used to complete the data extraction as an instruction and extract the data according to the extracted set. Constructing a 3D tensor , , a three-dimensional tensor Elements Indicates on date From the Transit Center Send to transshipment center The volume value of goods; A tensor decomposition module is connected to the three-dimensional tensor construction module and is used to perform tensor construction on the tensor as an instruction. Perform CP decomposition to obtain the factor components corresponding to the origin transshipment center dimension, destination transshipment center dimension, and date dimension A factor matrix construction module is connected to the tensor decomposition module to complete the tensor decomposition into instructions according to the decomposed factor components , construct the factor matrix on the three dimensions of origin transshipment center, destination transshipment center and date , the factor matrix Each row in represents a corresponding volume change factor of the origin transshipment center, destination transshipment center, and date; A feature replacement module is connected to the factor matrix construction module to convert the acquired feature data The category feature of the origin transit center in is replaced by the factor matrix The row vector corresponding to the originating transit center in is used to obtain the characteristic data The category feature of the destination transit center in is replaced by the factor matrix The row vector corresponding to the destination transfer center in the image is replaced by new feature data. ; A cargo volume prediction module is connected to the feature replacement module and is used to replace the feature data Input into the cargo volume prediction model based on gradient boosting decision tree training, and the model outputs the cargo volume prediction value .
8. The cargo volume prediction system combining tensor decomposition and gradient boosting decision tree according to claim 7, characterized in that: The cargo volume prediction system further includes: A model training module is used to train as well as Corresponding actual cargo volume data The sample is used for model training, and the cargo volume prediction model is formed based on gradient boosting decision tree training.
