Freight turnover prediction method and device based on VMD and random forest

By optimizing the hyperparameters of random forest using an improved VMD model and a cost-sensitive learning model, and combining the entropy method to calculate the weights, the problems of computational complexity, time consumption, and inaccurate results in freight turnover prediction are solved, achieving efficient and accurate prediction results.

CN121882840AInactive Publication Date: 2026-04-17汤梅
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
汤梅
Filing Date
2023-10-25
Publication Date
2026-04-17
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing technologies for freight turnover prediction suffer from computational complexity, time consumption, and inaccurate prediction results. In particular, the selection of regularization parameters for the VMD model is time-consuming, and the selection of hyperparameters for the random forest algorithm is unstable, leading to inaccurate prediction results.

Method used

An improved VMD model is used to predict the regularization parameter K through a balanced optimizer algorithm. The hyperparameters of the random forest are optimized by combining a cost-sensitive learning model. The weights of the subsequences are calculated by the entropy method, and the freight turnover dataset is decomposed into multiple subsequences for prediction.

Benefits of technology

It improves the computational efficiency and accuracy of freight turnover forecasting, reduces computation time, enhances model stability and generalization ability, and improves the accuracy of forecast results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121882840A_ABST
    Figure CN121882840A_ABST
Patent Text Reader

Abstract

The invention provides a freight turnover prediction method and device based on VMD and a random forest, and relates to the technical field of freight turnover prediction. Decomposing the freight turnover data set into K1 cargo quantity data sets by using a first improved VMD model; using a second improved VMD model to decompose each cargo quantity data group into K2 subsequences; optimizing hyper-parameters by using a cost-sensitive learning model to obtain an improved random forest model; respectively training the improved random forest model by using the K1 * K2 subsequences; and S5, collecting the training result of the K1 * K2 subsequences as a prediction result. In order to solve the problem that a freight turnover prediction result is not accurate enough, model parameters are predicted by using a balance optimizer algorithm, and the calculation time is shortened; the optimal hyper-parameter combination of the random forest is obtained through cost-sensitive learning, and the performance and generalization ability of the model are improved; the data set is subjected to secondary decomposition, the prediction result is obtained by using an entropy method, and the accuracy of the prediction result is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of freight turnover prediction technology, specifically to a freight turnover prediction method and apparatus based on VMD and random forest. Background Technology

[0002] Freight turnover refers to the total weight of all goods imported and exported within a specific logistics node per unit of time; in other words, it represents the flow of goods within that node. Freight turnover is a crucial indicator for measuring the operational capacity of a logistics node and is of great significance for logistics operations and management. Forecasting freight turnover can improve logistics operational efficiency, reduce logistics costs, thereby increasing the economic benefits for enterprises and enhancing customer satisfaction.

[0003] Existing technology (“A Freight Turnover Prediction Method Based on Variational Mode Decomposition and Random Forest Algorithm”, *China Storage & Transportation*, Ding Yi et al., 202304) discloses a freight turnover prediction method that uses variational mode decomposition to denoise time series data and random forest algorithm for prediction. Since freight turnover is a typical nonlinear time series data, it exhibits strong volatility and significant noise, making direct prediction difficult. It requires first using a multi-scale decomposition method, such as the VMD model, to decompose the time series signal into several stationary and regular subsequences. The VMD model can handle nonlinear and non-stationary signals and can extract different frequency components from the signal. Because the subsequences decomposed by the VMD model have clear mathematical interpretations and a clear understanding of the signal's meaning, the subsequences can be predicted one by one and then superimposed to obtain the final prediction result. However, conventional methods use multiple experiments to obtain the number of subsequences, i.e., the regularization parameter of the VMD model. This repetitive training method is not only computationally complex but also time-consuming. Furthermore, the final prediction result obtained by directly accumulating the predicted values ​​of the subsequences is not accurate enough.

[0004] Random forest algorithms have many advantages, such as high accuracy and the ability to handle high-dimensional data. However, because the internal operation of the model cannot be controlled, the selection of hyperparameters can only be done by trying different combinations, which results in excessive time consumption.

[0005] To address the issue of inaccurate freight turnover forecasting results, a freight turnover forecasting method and apparatus based on VMD and random forest are proposed. Summary of the Invention

[0006] The purpose of this invention is to provide a freight turnover prediction method based on VMD and random forest to solve the above-mentioned technical problems.

[0007] To achieve the above objectives, the present invention provides the following technical solution:

[0008] A freight turnover prediction method based on VMD and random forest, characterized by including:

[0009] S1. Decompose the freight turnover dataset into K1 freight volume data groups using the first improved VMD model. S11. Predict the regularization parameter K1 of the VMD model using the balanced optimizer algorithm, thereby constructing the first improved VMD model; the freight turnover dataset is a dataset of cumulative freight turnover for various modes of transportation, and the formula for the cumulative number is as follows:

[0010]

[0011] Where C represents the cumulative freight turnover of a particular mode of transport; M i The mass of the i-th batch of goods transported by the aforementioned means of transport; S i S11. The transportation distance of the i-th batch of goods; the balance optimization algorithm is trained using the freight turnover dataset to obtain the value of K1; S12. The first improved VMD model is trained using the freight turnover dataset; further, the VMD model is a variational mode decomposition model, which establishes a constrained optimization problem based on the component narrowband condition, thereby estimating the center frequency of the signal component and reconstructing the corresponding component.

[0012] Furthermore, the balanced optimizer algorithm performs iterative optimization based on the following formula.

[0013]

[0014] Where K is either K1 or K2, K0 is the solution of the previous iteration K, and K eq For the current optimal solution, F is the coefficient of the exponential term, λ is the random number vector, V is the control variable, and G is the generation rate;

[0015] S110. The balanced optimizer algorithm performs random initialization within the upper and lower bounds of K, as follows:

[0016]

[0017] in Let K be the initial value; K min Let K be the lower bound vector; K max γ is the upper bound vector of K; i Let i be the i-th random number vector;

[0018] S120. Select equilibrium states from the optimal candidate solutions, wherein the optimal candidate solutions constitute an equilibrium state pool, as follows:

[0019] K eq,pool ={K eq,1 K eq,2K eq,3 K eq,4 K eq,avg}

[0020] P(K eq,1 )=P(K eq,2 )=P(K eq,3 )=P(K eq,4 )=P(K eq,avg ) = 0.2

[0021] Where K eq,1 K eq,2 K eq,3 K eq,4 These are the four optimal solutions for the current iteration; K eq,avg This represents the average state of the four optimal solutions; the probability of each of the five solutions being selected is 0.2.

[0022] S130. Improve the coefficients of the exponential term to balance the local search and global search of the balanced optimizer algorithm, as shown in the following formula.

[0023] F=α*sign(γ-0.5)(e -λt -1)

[0024] Where α is the value of the constant weight coefficient of the global search; sign is the sign function; γ and λ are random number vectors, which are random numbers between 0 and 1, and the dimension of the random number vector is consistent with the dimension of the optimization space;

[0025] S140. Calculate the generation rate to enhance the local optimization capability of the balanced optimizer algorithm, as follows:

[0026] G = G KP (K eq -λK)

[0027]

[0028] Among them G KP The vector of control parameters for the generation rate;

[0029] S150. Updated solution, formula as follows:

[0030]

[0031] S160. Determine if the stopping condition is met. If it is met, output the result. If not, repeat S120 to S150.

[0032] S2. Decompose each of the cargo volume data groups into K2 subsequences using the second improved VMD model;

[0033] S21. Train the balance optimization algorithm using the cargo volume data set, obtain the value of K2, and thus construct the second improved VMD model.

[0034] S211. Decompose the freight turnover dataset into subsequences with finite bandwidths having a center frequency, wherein the sum of the estimated bandwidths of each subsequence is minimized, and the constraint is that the sum of all the subsequences is equal to the freight turnover dataset.

[0035] Furthermore, the constraint expression is as follows:

[0036]

[0037] Where {u k},{w k} correspond to the k-th subsequence component and the center frequency after decomposition, respectively; * is the convolution operator; δ(t) is the Dirac function.

[0038] S212. Introduce the Lagrange multiplier λ to transform the problem into an unconstrained one; by adding the Lagrange multiplier λ and a quadratic penalty factor, and substituting them into the constraint expression, a new unconstrained optimization formula is obtained, namely the Lagrange function expression.

[0039] Furthermore, the expression for the Lagrange function is as follows:

[0040]

[0041] Where β is the secondary penalty factor.

[0042] Furthermore, the constraints are that if the objective function needs to be minimized or maximized, the variables must satisfy certain restrictions. For example, in a support vector machine, if the margin needs to be maximized, the classifier must satisfy certain constraints, such as the functional margin being no less than 1 and the sum of the distances between the sample points and the classification surface being minimized.

[0043] S213. Solve the constrained problem using the ADMM alternating direction multiplier method; the ADMM alternating direction multiplier method fixes {u} contained in the Lagrange function expression. k},{w k}, any two of the three variables λ, update the variables that are not fixed.

[0044] Furthermore, the updated values ​​of the three variables are respectively λ n+1 The formula is as follows:

[0045]

[0046]

[0047]

[0048] The updated variables are solved by substituting the formulas for the three variables into the Lagrange function expression.

[0049] S22. Train the second improved VMD model using the cargo volume data set.

[0050] Furthermore, the K1 cargo volume data groups are respectively fed into the second improved VMD model, and each cargo volume data group is divided into K2 subsequences, for a total of K1×K2 subsequences.

[0051] S3. Optimize hyperparameters using a cost-sensitive learning model to obtain an improved random forest model.

[0052] Furthermore, the cost-sensitive learning model no longer uses a loss function, but instead uses the cost of misclassification to minimize conditional risk; by establishing a cost matrix, different types of costs are assigned to different types of errors, so that the number of high-cost errors and the sum of the costs of the high-cost errors are minimized during classification; the cost-sensitive learning model minimizes the loss by pruning the random forest model, thus obtaining the improved random forest model.

[0053] Furthermore, the cost matrix is ​​used to describe the cost of a decision error or classification error. In binary classification problems, the prediction results are typically categorized into four cases: true positive, false positive, true negative, and false negative. The cost matrix presents the costs of these four cases in matrix form. Generally, the rows of the cost matrix represent the actual situation, and the columns represent the prediction results, where each element represents the corresponding cost.

[0054] Furthermore, the random forest model integrates the prediction results of multiple decision tree models; by using the bagging concept, the important features and prediction results of the multiple decision trees are integrated by averaging.

[0055] Furthermore, the decision tree model is a classification and regression model based on a tree structure, which constructs a tree by recursively performing binary sorting operations on the dataset. Each internal node of the tree corresponds to a feature, and each leaf corresponds to a class label or numerical value.

[0056] Furthermore, the pruning process involves finding the optimal combination of hyperparameters and eliminating unnecessary parameter fitting. The hyperparameter combination includes the number of decision trees, the maximum depth of each decision tree, and the size of the feature subset.

[0057] S4. Train the improved random forest model using K1×K2 of the aforementioned subsequences respectively.

[0058] Furthermore, the subsequences are divided into training and testing sets respectively, and the improved random forest model is trained to obtain K1×K2 training results.

[0059] S5. The training results of the K1×K2 subsequences are used as the prediction results; the weights of the K1 cargo volume data sets and the K1×K2 subsequences are calculated using the entropy method.

[0060] Furthermore, the training results of the K1×K2 subsequences are set according to the following formula.

[0061]

[0062]

[0063] Where P i,j The result of training the improved random forest model for the i-th subsequence contained in the j-th cargo volume data set; P j The prediction result for the j-th cargo volume data group; W i,j V represents the weight of the i-th subsequence contained in the j-th cargo volume data group obtained using the entropy method; j The weight of the j-th cargo volume data group obtained using the entropy method.

[0064] Furthermore, the entropy method calculates weights based on the amount of information carried by the data, i.e., the entropy value; the greater the amount of information, the less uncertainty, and the smaller the entropy value.

[0065] Further, the weight of each subsequence in a cargo volume data set is calculated using the entropy method, and this process is repeated K1 times to obtain the weight of each subsequence in K1 cargo volume data sets; the weight of each cargo volume data set in the freight turnover data set is calculated using the entropy method.

[0066] A freight turnover prediction device based on VMD and random forest is characterized by:

[0067] The first optimization module is used to predict parameter K1 using the balanced optimizer algorithm to obtain the first improved VMD model;

[0068] The decomposition module is used to decompose the freight turnover dataset into K1×K2 subsequences using the first improved VMD model and the second improved VMD model;

[0069] The second optimization module is used to optimize hyperparameters using a cost-sensitive learning model to obtain an improved random forest model.

[0070] The training module is used to train the random forest model using K1×K2 subsequences respectively;

[0071] The set module is used to set the training results of K1×K2 of the subsequences as prediction results.

[0072] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0073] 1. The K value is the regularization parameter of the VMD model. A larger K value can improve the decomposition accuracy and signal-to-noise ratio, but it will lead to a narrower bandwidth, resulting in the loss of some important information; a smaller K value will lead to a wider bandwidth, thereby introducing some noise and unnecessary signal components. Therefore, the value of K becomes an important factor in constructing the VMD model. Conventional methods take multiple K values ​​and substitute them into the VMD model, repeat training, and compare the accuracy corresponding to each K value, which is time-consuming and computationally difficult. The balanced optimizer algorithm obtains the K value of the VMD model by iteratively optimizing within the upper and lower limits of the optimization variables. By fixing the K value, an improved VMD model is obtained, reducing computation time and improving computational accuracy.

[0074] 2. Random forest models integrate multiple decision trees. The number, depth, and feature subset size of each decision tree, among other hyperparameters, directly affect the performance and generalization ability of the random forest model. Decision trees are trained based on randomly selected samples and features, exhibiting a degree of randomness and lacking stability. By constructing the cost matrix of the random forest model using a cost-sensitive learning model and obtaining the optimal combination of hyperparameters, the model's performance and generalization ability can be improved, while reducing variance and uncertainty.

[0075] 3. After completing model training, directly summing the results of all freight volume data sets can lead to inaccurate freight turnover predictions. A second approach, substituting the data into the improved VMD model, further divides each freight volume data set into multiple subsequences. The weights of the subsequences and freight volume data sets are then obtained using the entropy method. This weighted summation method, applied twice, improves the accuracy of the prediction results. Attached Figure Description

[0076] Figure 1 A flowchart of a freight turnover prediction method based on VMD and random forest provided in an embodiment of the present invention;

[0077] Figure 2 A flowchart of S2 provided in an embodiment of the present invention;

[0078] Figure 3A flowchart of a freight turnover prediction device based on VMD and random forest provided for embodiments of the present invention. Detailed Implementation

[0079] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0080] Please see Figures 1 to 3 This invention provides a freight turnover prediction method based on VMD and random forest, the technical solution of which is as follows:

[0081] Specifically, refer to Figure 1 As shown, this invention provides a freight turnover prediction method based on VMD and random forest. This method can be executed by a device, which can be implemented by software and / or hardware. In a specific implementation, it includes steps S1 to S5.

[0082] Specifically, S1. Predict parameter K1 using the balance optimizer algorithm to obtain a first improved VMD model; the freight turnover dataset is a dataset consisting of the cumulative number of times the weight of each batch of goods actually transported by various means of transport is multiplied by its transport distance; train the balance optimization algorithm using the freight turnover dataset to obtain the value of parameter K1, thus obtaining the first improved VMD model; S2. Decompose the freight turnover dataset into K1×K2 subsequences using the first improved VMD model and the second improved VMD model; S21. Decompose the freight turnover dataset into K1 freight volume data groups using the first improved VMD model; S22. Use the balance optimization... The algorithm predicts parameter K2 to obtain a second improved VMD model; a balanced optimization algorithm is trained using one of the cargo volume data sets to obtain the value of parameter K2, thus obtaining the second improved VMD model; S23. Each cargo volume data set is decomposed into K2 subsequences using the second improved VMD model; S3. Hyperparameters are optimized using a cost-sensitive learning model to obtain an improved random forest model; S4. The improved random forest model is trained using K1×K2 subsequences respectively; S5. The training results of K1×K2 subsequences are combined as prediction results; the weights of K1 cargo volume data sets and K1×K2 subsequences are calculated using the entropy method respectively.

[0083] S1~S2 (refer to) Figure 2As shown, S1. The freight turnover dataset is decomposed into K1 freight volume data groups using the first improved VMD model. S11. The regularization parameter K1 of the VMD model is predicted using the balanced optimizer algorithm, thereby constructing the first improved VMD model; the freight turnover dataset is a dataset of cumulative freight turnover for various modes of transportation, and the formula for the cumulative number is as follows.

[0084]

[0085] Where C represents the cumulative freight turnover of a particular mode of transport; M i The mass of the i-th batch of goods transported by the aforementioned means of transport; S i S11. The transportation distance of the i-th batch of goods; the balance optimization algorithm is trained using the freight turnover dataset to obtain the value of K1; S12. The first improved VMD model is trained using the freight turnover dataset; further, the VMD model is a variational mode decomposition model, which establishes a constrained optimization problem based on the component narrowband condition, thereby estimating the center frequency of the signal component and reconstructing the corresponding component.

[0086] Specifically, the balanced optimizer algorithm performs iterative optimization based on the following formula.

[0087]

[0088] Where K is either K1 or K2, K0 is the solution of the previous iteration K, and K eq For the current optimal solution, F is the coefficient of the exponential term, λ is the random number vector, V is the control variable, and G is the generation rate;

[0089] S110. The balanced optimizer algorithm performs random initialization within the upper and lower bounds of K, as follows:

[0090]

[0091] in Let K be the initial value; K min Let K be the lower bound vector; K max γ is the upper bound vector of K; i Let i be the i-th random number vector;

[0092] S120. Select equilibrium states from the optimal candidate solutions, wherein the optimal candidate solutions constitute an equilibrium state pool, as follows:

[0093] K eq,pool ={K eq,1 K eq,2 K eq,3 K eq,4 K eq,avg}

[0094] P(K eq,1 )=P(K eq,2 )=P(K eq,3 )=P(K eq,4 )=P(K eq,avg ) = 0.2

[0095] Where K eq,1 K eq,2 K eq,3 K eq,4 These are the four optimal solutions for the current iteration; K eq,avg This represents the average state of the four optimal solutions; the probability of each of the five solutions being selected is 0.2.

[0096] S130. Improve the coefficients of the exponential term to balance the local search and global search of the balanced optimizer algorithm, as shown in the following formula.

[0097] F=α*sign(γ-0.5)(e -λt -1)

[0098] Where α is the value of the constant weight coefficient of the global search; sign is the sign function; γ and λ are random number vectors, which are random numbers between 0 and 1, and the dimension of the random number vector is consistent with the dimension of the optimization space;

[0099] S140. Calculate the generation rate to enhance the local optimization capability of the balanced optimizer algorithm, as follows:

[0100] G = G KP (K eq -λK)

[0101]

[0102] Among them G KP The vector of control parameters for the generation rate;

[0103] S150. Updated solution, formula as follows:

[0104]

[0105] S160. Determine if the stopping condition is met. If it is met, output the result. If not, repeat S120 to S150.

[0106] S2. Decompose each of the cargo volume data groups into K2 subsequences using the second improved VMD model;

[0107] S21. Train the balance optimization algorithm using the cargo volume data set, obtain the value of K2, and thus construct the second improved VMD model.

[0108] S211. Decompose the freight turnover dataset into subsequences with finite bandwidths having a center frequency, wherein the sum of the estimated bandwidths of each subsequence is minimized, and the constraint is that the sum of all the subsequences is equal to the freight turnover dataset.

[0109] Specifically, the constraint expression is as follows:

[0110]

[0111] Where {u k},{w k} correspond to the k-th subsequence component and the center frequency after decomposition, respectively; * is the convolution operator; δ(t) is the Dirac function.

[0112] S212. Introduce the Lagrange multiplier λ to transform the problem into an unconstrained one; by adding the Lagrange multiplier λ and a quadratic penalty factor, and substituting them into the constraint expression, a new unconstrained optimization formula is obtained, namely the Lagrange function expression.

[0113] Specifically, the expression for the Lagrange function is as follows:

[0114]

[0115] Where β is the secondary penalty factor.

[0116] Specifically, the constraints are that if the objective function needs to be minimized or maximized, the variables must satisfy certain restrictions. For example, in a support vector machine, if the margin needs to be maximized, the classifier must satisfy certain constraints, such as the functional margin being no less than 1 and the sum of the distances between the sample points and the classification surface being minimized.

[0117] S213. Solve the constrained problem using the ADMM alternating direction multiplier method; the ADMM alternating direction multiplier method fixes {u} contained in the Lagrange function expression. k},{w k}, any two of the three variables λ, update the variables that are not fixed.

[0118] Specifically, the updated values ​​of the three variables are respectively λ n+1 The formula is as follows:

[0119]

[0120]

[0121]

[0122] The updated variables are solved by substituting the formulas for the three variables into the Lagrange function expression.

[0123] S22. Train the second improved VMD model using the cargo volume data set.

[0124] Specifically, K1 cargo volume data groups are respectively fed into the second improved VMD model, and each cargo volume data group is divided into K2 subsequences, for a total of K1×K2 subsequences.

[0125] S3. Optimize hyperparameters using a cost-sensitive learning model to obtain an improved random forest model.

[0126] Specifically, the cost-sensitive learning model no longer uses a loss function, but instead uses the cost of misclassification to minimize conditional risk; by establishing a cost matrix, different types of costs are assigned to different types of errors, so that the number of high-cost errors and the sum of the costs of the high-cost errors are minimized during classification; the cost-sensitive learning model minimizes the loss by pruning the random forest model, thus obtaining the improved random forest model.

[0127] Specifically, the cost matrix describes the cost of a decision error or classification error. In binary classification problems, prediction results are typically categorized into four cases: true positive, false positive, true negative, and false negative. The cost matrix presents the costs of these four cases in matrix form. Generally, the rows of the cost matrix represent the actual situation, and the columns represent the prediction result, with each element representing the corresponding cost.

[0128] Specifically, the random forest model integrates the prediction results of multiple decision tree models; it integrates the important features and prediction results of the multiple decision trees by averaging the data using the bagging technique. Each decision tree in the random forest is trained on a random subsample, which is drawn from the dataset with replacement. The decision tree model is a tree-based classification and regression model that constructs a tree by recursively performing binary sorting operations on the dataset. Each internal node of the tree corresponds to a feature, and each leaf corresponds to a class label or value. At each node, the decision tree only considers a subset of the features. This randomness allows the training process of each decision tree to be more independent, thereby increasing the diversity of the ensemble model and improving its robustness and generalization ability.

[0129] Specifically, the pruning process involves finding the optimal combination of hyperparameters and eliminating unnecessary parameter fitting. The hyperparameter combination includes the number of decision trees, the maximum depth of each decision tree, and the size of the feature subset, among other things.

[0130] By constructing the cost matrix of a random forest model using a cost-sensitive learning model, and obtaining the optimal combination of hyperparameters, the performance and generalization ability of the model can be improved, while reducing the model's variance and uncertainty.

[0131] S4. Train the improved random forest model using K1×K2 of the aforementioned subsequences respectively.

[0132] Specifically, the subsequences are divided into training and testing sets, and the improved random forest model is trained to obtain K1×K2 training results.

[0133] S5. The training results of the K1×K2 subsequences are used as the prediction results; the weights of the K1 cargo volume data sets and the K1×K2 subsequences are calculated using the entropy method.

[0134] By using the entropy method to obtain the weights of the subsequence and cargo volume data groups, and then summing the weights twice, the accuracy of the prediction results can be improved.

[0135] Specifically, the training results of the K1×K2 subsequences are based on the following formula set.

[0136]

[0137]

[0138] Where P i,j The result of training the improved random forest model for the i-th subsequence contained in the j-th cargo volume data set; P j The prediction result for the j-th cargo volume data group; W i,j V represents the weight of the i-th subsequence contained in the j-th cargo volume data group obtained using the entropy method; j The weight of the j-th cargo volume data group obtained using the entropy method.

[0139] Specifically, the entropy method calculates weights based on the amount of information carried by the data, i.e., the entropy value; the greater the amount of information, the less uncertainty, and the smaller the entropy value.

[0140] Specifically, the weight of each subsequence in a cargo volume data set is calculated using the entropy method, and this process is repeated K2 times to obtain the weight of each subsequence in K1 cargo volume data sets; the weight of each cargo volume data set in the freight turnover data set is then calculated using the entropy method.

[0141] In summary, this invention first uses a balanced optimizer to select values ​​for the parameter K of the VMD model. Through multiple iterations within the upper and lower limits of the optimization variables, the optimal K value for the VMD model is obtained. By fixing the K value, an improved VMD model is obtained, reducing computation time and improving computational accuracy. The dataset is then subjected to two levels of decomposition in the improved VMD model to obtain multiple subsequences. These subsequences are then substituted into the algorithm model, resulting in more accurate predictions. Next, a cost-sensitive learning model is used to optimize the hyperparameters, resulting in an improved random forest model. Since the random forest model integrates multiple decision trees, the number, depth, and feature subset size of each decision tree directly affect its performance and generalization ability. Decision trees are trained based on randomly selected samples and features, exhibiting a degree of randomness and lacking stability. Constructing the cost matrix of the random forest model using a cost-sensitive learning model and obtaining the optimal hyperparameter combination can improve the model's performance and generalization ability while reducing variance and uncertainty. After model training, directly summing the results of all freight volume data sets can lead to inaccurate freight turnover predictions. The improved VMD model is substituted twice, and each cargo volume data group is further divided into multiple subsequences. The weights of the subsequences and cargo volume data groups are obtained by using the entropy method. The weights are summed twice to improve the accuracy of the prediction results.

[0142] Figure 3 The flowchart of the freight turnover prediction device based on VMD and random forest provided in the embodiments of the present invention is shown below. Figure 3 As shown, the specific technical solution is as follows:

[0143] S100. First optimization module, used to decompose the freight turnover dataset into K1 freight volume data groups using a first improved VMD model; S200. Decomposition module, used to decompose each freight volume data group into K2 sub-sequences using a second improved VMD model; S300. Second optimization module, used to optimize hyperparameters using a cost-sensitive learning model to obtain an improved random forest model; S400. Training module, used to train the random forest model using K1×K2 sub-sequences respectively; S500. Set module, used to set the training results of K1×K2 sub-sequences as prediction results.

[0144] S100. First optimization module, used to decompose the freight turnover dataset into K1 freight volume data groups using the first improved VMD model.

[0145] Specifically, the balanced optimizer algorithm performs iterative optimization based on the following formula.

[0146]

[0147] Where K is the current solution, K0 is the solution from the previous iteration, and K... eq Let F be the coefficient of the exponential term, λ be the random number vector, V be the control variable, and G be the generation rate. The value of K is obtained through the balanced optimizer and substituted into the VMD model to obtain the improved VMD model.

[0148] S200. Decomposition module, used to decompose each of the cargo volume data groups into K2 subsequences using a second improved VMD model.

[0149] Specifically, it consists of three steps:

[0150] S21. Using the first improved VMD model, the freight turnover dataset is decomposed into K1 freight volume data groups;

[0151] S211. Decompose the freight turnover dataset into subsequences with finite bandwidths having a center frequency, wherein the sum of the estimated bandwidths of each subsequence is minimized, and the constraint is that the sum of all the subsequences is equal to the freight turnover dataset.

[0152] Specifically, the constraint expression is as follows:

[0153]

[0154] Where {u k},{w k} correspond to the k-th subsequence component and the center frequency after decomposition, respectively; * is the convolution operator; δ(t) is the Dirac function.

[0155] S212. Introduce the Lagrange multiplier λ to transform the problem into a constrained problem; by adding the Lagrange multiplier λ and a quadratic penalty factor, and substituting them into the constraint expression, a new unconstrained optimization formula is obtained, namely the Lagrange function expression.

[0156] Specifically, the expression for the Lagrange function is as follows:

[0157]

[0158] Where β is the secondary penalty factor.

[0159] S213. Solve the constrained problem using the ADMM alternating direction multiplier method; the ADMM alternating direction multiplier method fixes {u} contained in the Lagrange function expression. k},{w k}, any two of the three variables λ, update the variables that are not fixed.

[0160] Specifically, the updated values ​​of the three variables are respectively λ n+1 The formula is as follows:

[0161]

[0162]

[0163]

[0164] The updated variables are solved by substituting the formulas for the three variables into the Lagrange function expression.

[0165] S22. Predict parameter K2 using the balance optimizer algorithm to obtain the second improved VMD model; train the balance optimization algorithm using one of the cargo volume data sets to obtain the value of parameter K2 and obtain the second improved VMD model.

[0166] Specifically, K1 cargo volume data groups are respectively fed into the improved VMD model, and each cargo volume data group is divided into K2 subsequences, for a total of K1×K2 subsequences.

[0167] S23. Decompose each of the cargo volume data groups into K2 subsequences using the second improved VMD model.

[0168] By substituting the dataset twice into the improved VMD model for secondary decomposition, more detailed subsequences are obtained, making the prediction results more accurate.

[0169] S300. The second optimization module is used to optimize hyperparameters using a cost-sensitive learning model to obtain an improved random forest model.

[0170] Specifically, the cost-sensitive learning model no longer uses a loss function, but instead uses the cost of misclassification to minimize conditional risk; by establishing a cost matrix, different types of costs are assigned to different types of errors, so that the number of high-cost errors and the sum of the costs of the high-cost errors are minimized during classification; the cost-sensitive learning model minimizes the loss by pruning the random forest model, thus obtaining the improved random forest model.

[0171] S400. Training module, used to train the random forest model using K1×K2 subsequences respectively.

[0172] Specifically, the subsequences are divided into training and testing sets, and the improved random forest model is trained to obtain K1×K2 training results.

[0173] S500. Set module, used to set the training results of K1×K2 of the subsequences as prediction results.

[0174] Specifically, the training results of the K1×K2 subsequences are based on the following formula set.

[0175]

[0176]

[0177] Where P i,j The result of training the improved random forest model for the i-th subsequence contained in the j-th cargo volume data set; P j The prediction result for the j-th cargo volume data group; W i,j V represents the weight of the i-th subsequence contained in the j-th cargo volume data group obtained using the entropy method; j The weight of the j-th cargo volume data group obtained using the entropy method.

[0178] Specifically, the weight of each subsequence in a cargo volume data set is calculated using the entropy method, and this process is repeated K2 times to obtain the weight of each subsequence in K1 cargo volume data sets; the weight of each cargo volume data set in the freight turnover data set is then calculated using the entropy method.

[0179] Specifically, the working principle of this device is based on the aforementioned freight turnover prediction method based on VMD and random forest.

[0180] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A freight turnover prediction method based on VMD and random forest, characterized in that, include: S1. The freight turnover dataset is decomposed into K1 freight volume data groups using the first improved VMD model; S11. Predict the regularization parameter K1 of the VMD model using the balanced optimizer algorithm, thereby constructing the first improved VMD model; The freight turnover dataset is a dataset of cumulative freight turnover for various modes of transportation, and the formula for the cumulative number is as follows: Where C represents the cumulative freight turnover of a particular mode of transport; M i The mass of the i-th batch of goods transported by the aforementioned means of transport; S i Let be the transportation distance of the i-th batch of goods; The balance optimization algorithm is trained using the freight turnover dataset to obtain the value of K1; S12. Train the first improved VMD model using the freight turnover dataset; S2. Decompose each of the cargo volume data groups into K2 subsequences using the second improved VMD model; S21. Train the balance optimization algorithm using the cargo volume data set, obtain the value of K2, and thus construct the second improved VMD model; S22. Train the second improved VMD model using the cargo volume data set; S3. Optimize hyperparameters using a cost-sensitive learning model to obtain an improved random forest model; The hyperparameters include the number of decision trees, the maximum depth of each decision tree, and the size of the feature subset; S4. Train the improved random forest model using K1×K2 of the aforementioned subsequences respectively; S5. The training results of the K1×K2 subsequences are used as the prediction results; The weights of the K1 cargo volume data sets and the K1×K2 subsequences are calculated using the entropy method.

2. The method according to claim 1, characterized in that, The balance optimizer algorithm in S1 includes: The balanced optimizer algorithm performs iterative optimization based on the following formula. Where K is either K1 or K2, K0 is the solution of the previous iteration K, and K eq For the current optimal solution, F is the coefficient of the exponential term, λ is the random number vector, V is the control variable, and G is the generation rate; S110. The balanced optimizer algorithm performs random initialization within the upper and lower bounds of K, as follows: in Let K be the initial value; K min Let K be the lower bound vector; K max γ is the upper bound vector of K; i Let i be the i-th random number vector; S120. Select equilibrium states from the optimal candidate solutions, wherein the optimal candidate solutions constitute an equilibrium state pool, as follows: K eq,pool ={K eq,1 ,K eq,2 ,K eq,3 ,K eq,4 ,K eq,avg } P(K eq,1 )=P(K eq,2 )=P(K eq,3 )=P(K eq,4 )=P(K eq,avg )=0.2 Where K eq,1 K eq,2 K eq,3 K eq,4 These are the four optimal solutions for the current iteration; K eq,avg This represents the average state of the four optimal solutions; the probability of each of the five solutions being selected is 0.

2. S130. Improve the coefficients of the exponential term to balance the local search and global search of the balanced optimizer algorithm, as shown in the following formula. F=α*sign(γ-0.5)(e -λt -1) Where α is the value of the constant weight coefficient of the global search; sign is the sign function; γ and λ are random number vectors, which are random numbers between 0 and 1, and the dimension of the random number vector is consistent with the dimension of the optimization space; S140. Calculate the generation rate to enhance the local optimization capability of the balanced optimizer algorithm, as follows: G=G KP (K eq -λK) Among them G KP The vector of control parameters for the generation rate; S150. Updated solution, formula as follows: S160. Determine if the stopping condition is met. If it is met, output the result. If not, repeat S12 to S15.

3. The method according to claim 1, characterized in that, S21 includes: S211. Decompose the freight turnover dataset into subsequences with finite bandwidths having a center frequency, wherein the sum of the estimated bandwidths of each subsequence is minimized, and the constraint is that the sum of all the subsequences is equal to the freight turnover dataset. S212. Introduce the Lagrange multiplication operator λ to transform the problem into an unconstrained one; By adding the Lagrange multiplier λ and a quadratic penalty factor, and substituting them into the constraint expression, a new unconstrained optimization expression is obtained, namely the Lagrange function expression. S213. Solve the constrained problem using the ADMM alternating direction multiplier method; The ADMM alternating direction multiplier method fixes the {u} contained in the Lagrange function expression. k },{w k }, any two of the three variables λ, update the variables that are not fixed.

4. The method according to claim 3, characterized in that, S211 includes: The constraint condition expression is as follows: Where {u k } represents the k-th subsequence component after decomposition; {w k } represents the center frequency; * represents the convolution operator; δ(t) represents the Dirac function.

5. The method according to claim 1, characterized in that, S22 includes: The K1 cargo volume data groups are respectively fed into the second improved VMD model, and each cargo volume data group is divided into K2 subsequences, for a total of K1×K2 subsequences.

6. The method according to claim 1, characterized in that, The cost-sensitive learning model in S3 includes: The cost-sensitive learning model minimizes conditional risk by using the cost of misclassification. By establishing the cost matrix of the freight turnover, the errors of high cost values ​​and the sum of the high cost values ​​are minimized; Different types of errors in the cost matrix have different costs. The cost-sensitive learning model minimizes the loss by pruning the random forest model, thus obtaining the improved random forest model.

7. The method according to claim 6, characterized in that, The random forest model includes: The random forest model integrates the prediction results of multiple decision tree models; By averaging, the key features of the multiple decision trees and the prediction results of the freight turnover are combined. The key feature is the freight turnover feature that is most frequently used when branching the multiple decision tree models.

8. The method according to claim 1, characterized in that, S5 includes: The training results of the K1×K2 subsequences are based on the following formula set. Where P i,j The result of training the improved random forest model for the i-th subsequence contained in the j-th cargo volume data set; P j The prediction result for the j-th cargo volume data group; W i,j V represents the weight of the i-th subsequence contained in the j-th cargo volume data group obtained using the entropy method; j The weight of the j-th cargo volume data group obtained using the entropy method.

9. The method according to claim 8, characterized in that, The entropy method includes: calculating weights based on the amount of information carried by the data, i.e., the entropy value; the greater the amount of information, the less uncertainty, and the smaller the entropy value.

10. A freight turnover prediction device based on VMD and random forest, characterized in that: The first optimization module is used to decompose the freight turnover dataset into K1 freight volume data groups using the first improved VMD model; A decomposition module is used to decompose each of the cargo volume data groups into K2 subsequences using a second improved VMD model; The second optimization module is used to optimize hyperparameters using a cost-sensitive learning model to obtain an improved random forest model. The training module is used to train the random forest model using K1×K2 subsequences respectively; The set module is used to set the training results of K1×K2 of the subsequences as prediction results.