Electric power material demand prediction method based on gradient boosting decision tree algorithm
Through the power material demand prediction method based on the gradient enhancement decision tree algorithm, the traditional method's insufficient accuracy and adaptability problems in complex nonlinear relationship processing are solved, high-precision and stable prediction results are achieved, and power material procurement and supply chain management are supported.
Patent Information
- Application Number
- CN202510716906.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-08-15
AI Technical Summary
The traditional power material demand prediction method is insufficient in dealing with complex nonlinear relationships, cannot effectively capture the interaction effects of multidimensional data, and is difficult to adapt to large-scale data sets, and lacks dynamic adaptability and real-time prediction capabilities.
The power material demand prediction method based on the gradient enhancement decision tree algorithm is adopted, including data acquisition and preprocessing, feature engineering optimization, training set and test set division, model training, hyperparameter tuning, model verification and evaluation, and real-time application deployment. Through feature interaction effect analysis, dynamic weight adjustment and adaptive parameter optimization, the prediction accuracy and stability of the model are improved.
It significantly improves the model's ability to capture complex nonlinear relationships, enhances prediction accuracy and generalization capabilities, realizes dynamic updates and real-time responses, and provides reliable support for power material procurement and supply chain management.
Smart Images

Figure CN120494206A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power material management, and in particular to a method for predicting power material demand based on a gradient boosting decision tree algorithm. Background Art
[0002] Power material demand forecasting plays a key role in logistics management and inventory control within the power supply chain. Its accuracy directly impacts the formulation of material procurement plans and the efficiency of supply chain management. Traditional demand forecasting methods primarily include moving average forecasting based on time series models and multiple linear regression analysis. The moving average forecasting method uses a sliding average of historical data to predict future demand trends. However, this method ignores other key factors that may influence demand, such as market fluctuations and supply chain changes, and therefore has limited accuracy in complex power material demand forecasting tasks. Multiple linear regression, on the other hand, estimates the relationship between demand and other variables by establishing a linear model. However, its ability to model nonlinear relationships is limited, making it difficult to capture the complex patterns of change in power material demand, resulting in potentially inaccurate forecast results.
[0003] In recent years, with the development of machine learning technology, the gradient boosting decision tree (GBDT) algorithm has gradually been applied to the field of demand forecasting. As a powerful ensemble learning algorithm, GBDT can gradually improve predictive capabilities by iteratively training multiple decision tree models, and can effectively handle nonlinear relationships and high-dimensional features. However, existing technologies still have many shortcomings when applying GBDT to power material demand forecasting. For example, data preprocessing methods are not perfect and fail to fully explore the potential features in the data; feature selection and combination strategies are relatively simple, limiting the model's predictive performance; and the hyperparameter optimization process lacks systematicity, which may lead to insufficient generalization of the model. Furthermore, the dynamic adaptability and real-time prediction capabilities of existing methods in actual business scenarios still need to be improved. Summary of the Invention
[0004] In response to the shortcomings of the existing technology, the present invention provides a method for forecasting power material demand based on the gradient boosting decision tree algorithm, which solves the problems of traditional forecasting methods such as insufficient accuracy in dealing with complex nonlinear relationships, inability to effectively capture the interaction effects of multidimensional data, and difficulty in adapting to large-scale data sets.
[0005] To achieve the above objectives, the present invention is implemented through the following technical solutions: a method for predicting power material demand based on a gradient boosting decision tree algorithm, comprising the following steps: Step 1: Data collection and preprocessing: Collect historical demand data, supply chain information, market dynamics, and other relevant variables. Clean the data to remove outliers and missing values, and use interpolation or mean filling to fill in incomplete records. Step 2: Feature engineering optimization, which involves performing feature selection and feature combination operations on the original data to screen out key features that have a significant impact on the prediction target, and generating new features that reflect potential interaction effects through mathematical operations; Step 3: Split the dataset into training and test sets according to the set ratio to ensure that the model can effectively evaluate the generalization ability. Step 4: Model training, using the improved gradient boosting decision tree algorithm to iteratively train the training set and gradually optimize the prediction ability; Step 5: Hyperparameter tuning, adjust key parameters such as the number of trees, maximum depth, learning rate, etc. to improve the fitting effect and stability of the model; Step 6: Model validation and evaluation: Use the test set to evaluate the performance of the trained model and calculate indicators such as mean square error, mean absolute error, and coefficient of determination to ensure the accuracy of the prediction results. Step 7: Real-time application deployment: run the model in the actual business environment and collect feedback data, and dynamically update the model to adapt to changing demand patterns.
[0006] Preferably, the data preprocessing in step 1 further includes normalizing or standardizing the features so that each feature is in the same order of magnitude, thereby improving the model training efficiency.
[0007] Preferably, in step 2, the feature selection method includes one or more of information gain, chi-square test, and recursive feature elimination, and redundant features are gradually eliminated through multiple trainings to retain the optimal feature set.
[0008] Preferably, in step 4, an adaptive weight adjustment mechanism is introduced during the model training process to dynamically allocate weights according to feature importance to further improve prediction accuracy.
[0009] Preferably, in step five, the hyperparameter tuning module determines the optimal parameter combination through a grid search or random search strategy, and combines cross-validation to ensure the robustness of the model.
[0010] Preferably, in step seven, the real-time application deployment module supports dynamic data stream access and continuously optimizes model performance through an online learning mechanism to ensure that the prediction results always meet actual needs.
[0011] Preferably, the feature combination method based on feature interaction effect further includes: analyzing the correlation between single features, designing specific mathematical operation rules to generate new features, and verifying its effect on improving the prediction ability through experiments.
[0012] Preferably, the model training method based on the dynamic weight adjustment mechanism further includes: dynamically adjusting the weight distribution according to the feature importance score; if the importance score of a certain feature is S, and when S < T, reducing the weight of this feature; when S > T, increasing the weight, where T represents the set importance threshold.
[0013] Preferably, the model optimization method based on hyperparameter tuning further includes: setting the initial parameter range and performing multiple iterative evaluations; if the performance index P of the current parameter combination satisfies P > Pmin, recording this parameter combination; otherwise, continue searching until the optimal solution is found, where Pmin represents the preset minimum performance index requirement.
[0014] Preferably, the specific formula for the normalization process is: x' is equal to (x minus minx) divided by (maxx minus minx)); where x represents the original feature value, x' is the value after normalization, and min(x) and max(x) are the minimum and maximum values of this feature respectively.
[0015] Preferably, the feature combination method based on feature interaction effects further includes analyzing the correlation between single features, designing specific mathematical operation rules to generate new features, and verifying the improvement effect on the prediction ability through experiments. <着
[0016] The present invention provides a method for predicting the demand for electric power materials based on the gradient boosting decision tree algorithm. It has the following beneficial effects: 1. By optimizing the feature engineering of multi-dimensional data, the present invention improves the model's ability to capture complex non-linear relationships and enhances the prediction accuracy.
[0017] 2. Through the dynamic weight adjustment mechanism and the adaptive parameter optimization strategy, the present invention improves the stability and generalization ability of the model, enabling it to adapt to diverse prediction scenarios.
[0018] 3. Through the real-time application deployment module, the present invention realizes the functions of dynamic update and online learning, ensuring that the prediction results can respond to demand changes in a timely manner and providing reliable support for the procurement of electric power materials and supply chain management.
[0019] 4. By introducing the feature interaction effect analysis and optimization strategy, the present invention further explores the potential laws in the data and significantly improves the performance of the prediction model. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 It is a schematic diagram of the overall process of the present invention.
[0021] Figure 2 It is a schematic diagram of the key steps of data collection and preprocessing and the process of outlier handling of the present invention.
[0022] Figure 3 Schematic diagram of the implementation process of feature selection and combination in feature engineering optimization of the present invention.
[0023] Figure 4 Schematic diagram of the ratio setting and data distribution control of the training set and test set division of the present invention.
[0024] Figure 5 Schematic diagram of the working principle of the adaptive weight adjustment mechanism during the model training process of the present invention.
[0025] Figure 6 Schematic diagram of the execution flow of grid search and cross-validation in the hyperparameter tuning module of the present invention.
[0026] Figure 7 Schematic diagram of the logical structure of performance index calculation in the model verification and evaluation stage of the present invention.
[0027] Figure 8 This is a schematic diagram of the operation of the dynamic data stream access and online learning mechanism in the real-time application deployment module of the present invention. DETAILED DESCRIPTION
[0028] The following will clearly and completely describe the technical solution of the present invention in conjunction with the accompanying drawings. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0029] The present invention provides a method for predicting power material demand based on a gradient boosting decision tree algorithm. Figure 1 -Attached Figure 8 Provide a detailed description. Figure 1 The overall process diagram is presented, which includes steps such as data collection and preprocessing, feature engineering optimization, training and test set division, model training, hyperparameter tuning, model validation and evaluation, and real-time application deployment. The following technical solution is described in detail with reference to the accompanying figures and specific examples.
[0030] In the data collection and preprocessing stage, such as Figure 2As shown, historical demand data, supply chain information, market dynamics, and other relevant variables are first collected from multiple source systems. These data sources include, but are not limited to, the power company's material management system, market research reports, supplier databases, and macroeconomic indicators. To ensure data quality, the raw data must be cleaned to remove outliers and missing values. Outliers are detected using the Z-score method or boxplot method. If a data point deviates from the mean by more than three standard deviations, it is considered an outlier and removed. Missing values are addressed by interpolation or mean filling, depending on the data characteristics. For example, linear interpolation is used to fill missing records for time series data, while column mean filling is used for non-time series data. Furthermore, to improve model training efficiency, features must be normalized or standardized to ensure that they are within the same order of magnitude. The specific normalization formula is x' = (x - minx)) / (maxx - minx)) where x represents the original feature value, x' is the normalized value, and min(x) and max(x) are the minimum and maximum values of the feature, respectively. Through the above processing, input data with uniform format and reliable quality is finally obtained.
[0031] Feature engineering optimization is an important part of improving model performance. Its implementation process is as follows: Figure 3 As shown in the figure, in this stage, various feature selection methods are first used to identify key features that have a significant impact on the prediction target. Specifically, the information gain method is used to calculate the contribution of each feature to the target variable, and features with high information gain are retained. The chi-square test is used to analyze the correlation between the categorical variable and the target variable, eliminating irrelevant variables. Furthermore, a recursive feature elimination method is introduced to gradually eliminate redundant features through multiple training sessions, ultimately retaining the optimal feature set. Regarding feature combination, correlations between individual features are analyzed and specific mathematical operations are designed to generate new features. For example, assuming a strong interaction between features A and B, a new feature C = A × B or C = A / B can be constructed (assuming B is non-zero). Experiments verify the improved predictive ability of the new feature combination. The matrix operation module in programming languages can be used to efficiently implement feature combination.
[0032] The division ratio of training set and test set and its data distribution control are as follows: Figure 4As shown. In actual operation, the dataset is divided into a training set and a test set according to a ratio of 7:3 or 8:2, that is, 70% of the data is used for model training and 30% of the data is used for model validation. To ensure that the model can effectively evaluate the generalization ability, the stratified sampling method needs to be adopted during the division process to ensure that the distribution ratios of various types of samples in the training set and the test set are the same. For example, if the target variable is a binary classification problem and the ratio of positive and negative samples is 1:3, the same distribution ratio should also be maintained in the training set and the test set. In addition, to avoid data leakage problems, the training set and the test set need to be strictly separated to ensure that the test set is not used during the entire training process.
[0033] The model training process is as Figure 5 shown. The improved gradient boosting decision tree algorithm is used to iteratively train the training set. The core idea of the gradient boosting decision tree is to construct a strong learner through the weighted combination of a series of weak learners (usually decision trees). Specifically, in each round of iteration, a new decision tree is constructed based on the residuals of the current model, and the loss function is minimized by the gradient descent method. The loss function usually selects the mean squared error (MSE) or the mean absolute error (MAE), and their mathematical expressions are MSE = 1 / n∑(y_i - ŷ_i)^2 and MAE = 1 / n∑|y_i - ŷ_i| respectively, where y_i is the true value, ŷ_i is the predicted value, and n is the number of samples. In the present invention, an adaptive weight adjustment mechanism is introduced during the model training process, and weights are dynamically assigned according to the feature importance. The specific formula is w_i = w_i × (1 + α × S_i / T), where w_i represents the weight of the i-th feature, S_i is the importance score of this feature, T is the set importance threshold, and α is the adjustment coefficient. If S_i < T, the weight of this feature is reduced; if S_i > T, the weight is increased. Through this dynamic adjustment mechanism, the prediction accuracy of the model is further improved.
[0034] The execution process of the hyperparameter tuning module is as Figure 6 shown. The best parameter combination is determined through a grid search or a random search strategy. Specifically, first, the initial parameter range is set. For example, the range of the number of trees is 50 - 200, the range of the maximum depth is 3 - 10, and the range of the learning rate is 0.01 - 0.1. Then, multiple iterative evaluations are carried out. Each time, a set of parameter combinations is selected to train the model, and its performance is evaluated through cross-validation. The specific implementation of cross-validation is to divide the training set into k folds (usually k takes 5 or 10), and the model is trained using k - 1 folds of data in turn and its performance is verified on the remaining 1 fold of data. Finally, the average value of the k verification results is taken as the performance index P of this parameter combination. If the performance index P of the current parameter combination satisfies P > Pmin, record this parameter combination; otherwise, continue the search until the optimal solution is found. Here, Pmin represents the preset minimum performance index requirement. Through the above tuning process, the robustness and stability of the model are ensured.
[0035] The logical structure of performance indicator calculation in the model verification and evaluation phase is as follows: Figure 7 As shown in the figure, after model training, the test set is used to evaluate model performance, calculating metrics such as mean squared error, mean absolute error, and coefficient of determination. The coefficient of determination (R^2) is calculated as R^2 = 1-∑(y_i - ŷ_i)^2 / ∑(y_i - y̅)^2, where y̅ is the mean of the true values. This comprehensive evaluation of these metrics ensures the accuracy of the prediction results. Furthermore, to further verify the model's effectiveness, a comparison chart of the predicted values against the true values is plotted to visually demonstrate the model's fitting ability.
[0036] The operating principle of the real-time application deployment module is as follows Figure 8 As shown in the figure. In a real business environment, the trained model is deployed to the production system and supports dynamic data stream access. The model performance is continuously optimized through the online learning mechanism to ensure that the prediction results always meet actual needs. Specifically, when new data flows in, the model automatically predicts it and feeds the results back to the business system. At the same time, the system regularly collects feedback data and dynamically updates the model. The update process includes steps such as retraining the model, adjusting hyperparameters, and optimizing feature engineering. To improve update efficiency, an incremental learning method can be used to train only on newly added data rather than retraining the entire dataset. In addition, to ensure the stable operation of the system, a monitoring mechanism must be established to track changes in model performance indicators in real time and trigger an alarm mechanism when the indicators decline.
[0037] In summary, the present invention implements a method for forecasting the demand for electric power materials based on the gradient boosting decision tree algorithm through the above-mentioned specific implementation methods. In actual application scenarios, for example, a provincial power company needs to predict the demand for cables in the next three months, and the present invention can be implemented according to the above steps. First, key features are extracted from multi-source data such as historical procurement records, power grid construction plans, and market supply and demand changes, and the variables with the most predictive value are screened out through feature engineering optimization. Then, the improved gradient boosting decision tree algorithm is used to train the model, and the optimal parameter combination is determined in combination with the hyperparameter tuning module. Finally, the trained model is deployed to the production system, and the prediction performance is continuously optimized through the online learning mechanism. Practice has shown that this method can significantly improve the prediction accuracy and provide reliable support for electric power material procurement and supply chain management.
[0038] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.
Claims
1. A method for predicting power material demand based on a gradient boosting decision tree algorithm, characterized in that: The following steps are involved: Step 1: Data collection and preprocessing Collect historical demand data, supply chain information, market dynamics, and other relevant variables, clean the data to remove outliers and missing values, and use interpolation or mean filling to fill in incomplete records; Step 2: Feature Engineering Optimization Perform feature selection and feature combination operations on the original data to screen out key features that have a significant impact on the prediction target, and generate new features that reflect potential interaction effects through mathematical operations; Step 3: Split the training set and test set Divide the dataset into training and test sets according to the set ratio to ensure that the model can effectively evaluate the generalization ability; Step 4: Model training The improved gradient boosting decision tree algorithm is used to iteratively train the training set and gradually optimize the prediction ability; Step 5: Hyperparameter Tuning Adjust key parameters including but not limited to the number of trees, maximum depth, and learning rate to improve model fitting and stability; Step 6: Model Validation and Evaluation Use the test set to evaluate the performance of the trained model and calculate the mean square error, mean absolute error, and coefficient of determination. Step 7: Real-time application deployment Run the model in the actual business environment and collect feedback data, dynamically updating the model to adapt to changing demand patterns.
2. The method for predicting power material demand based on the gradient boosting decision tree algorithm according to claim 1 is characterized in that: The data preprocessing in step 1 also includes normalizing or standardizing the features so that the features are in the same order of magnitude.
3. The method for predicting power material demand based on the gradient boosting decision tree algorithm according to claim 1, characterized in that: In the step 2, the feature selection method includes one or more of information gain, chi-square test and recursive feature elimination, and redundant features are gradually eliminated through multiple trainings to retain the optimal feature set.
4. The method for predicting power material demand based on the gradient boosting decision tree algorithm according to claim 1, characterized in that: In step 4, an adaptive weight adjustment mechanism is introduced into the model training process to dynamically allocate weights according to feature importance to further improve prediction accuracy.
5. The method for predicting power material demand based on the gradient boosting decision tree algorithm according to claim 1, characterized in that: In step five, the hyperparameter tuning module determines the optimal parameter combination through grid search or random search strategy, and combines cross-validation to ensure the robustness of the model.
6. The method for predicting power material demand based on the gradient boosting decision tree algorithm according to claim 1, characterized in that: In step seven, the real-time application deployment module supports dynamic data stream access and continuously optimizes model performance through an online learning mechanism.
7. The method for predicting power material demand based on the gradient boosting decision tree algorithm according to claim 4, characterized in that: The model training method based on the dynamic weight adjustment mechanism further includes: Dynamically adjust weight distribution based on feature importance scores; If the importance score of a feature is S, and when S is less than T, reduce the weight of the feature; When S is greater than T, the weight is increased, where T represents the set importance threshold.
8. The method for predicting power material demand based on the gradient boosting decision tree algorithm according to claim 5, characterized in that: Model optimization methods based on hyperparameter tuning further include: Set initial parameter ranges and perform multiple iterative evaluations; If the performance index P of the current parameter combination satisfies P greater than Pmin, then record the parameter combination; Otherwise, continue searching until the optimal solution is found, where Pmin represents the preset minimum performance index requirement.
9. The method for predicting power material demand based on the gradient boosting decision tree algorithm according to claim 2, characterized in that: The specific formula for the normalization process is: x' is equal to (x minus minx) divided by (maxx minus minx); Where x represents the original eigenvalue, x' is the normalized value, min(x) and max(x) are the minimum and maximum values of the feature, respectively.
10. The method for predicting power material demand based on the gradient boosting decision tree algorithm according to claim 3, characterized in that: The feature combination method based on feature interaction effects further includes analyzing the correlation between single features, designing specific mathematical operation rules to generate new features, and verifying its effect on improving predictive ability through experiments.