Time series data prediction system and method based on XGBOOST
By building a mutual information network between photovoltaic power stations and using XGBOOST model, combining the LSTM layer to extract timing characteristics, the problem of low prediction accuracy of photovoltaic power generation is solved, and higher prediction accuracy and generalization capabilities are achieved.
Patent Information
- Application Number
- CN202411181723.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2024-12-13
AI Technical Summary
The existing photovoltaic power generation prediction methods have the problem of low prediction accuracy, especially the failure to effectively consider the mutual influence between multiple photovoltaic power stations, resulting in low prediction accuracy.
The time series data prediction system based on XGBOOST is adopted to build a mutual information network between power stations, and extract timing features in combination with the LSTM layer, use an integrated learning method to predict power generation, and add regularization terms to avoid overfitting.
It improves the accuracy of prediction and generalization ability of the model, enhances the capture of dynamic characteristics of power generation changes, ensures that the model is continuously optimized during the training process until it converges, and improves the prediction performance on unknown data.
Smart Images

Figure CN119130184A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power generation prediction, and in particular to a time series data prediction system and method based on XGBOOST. Background Art
[0002] Photovoltaic power generation prediction mainly includes physical, statistical and machine learning methods. The physical method captures solar radiation, calculates the total irradiance, derives the photocurrent, estimates the battery temperature, draws the current-voltage characteristic curve, predicts the power output, and accumulates the total power generation. The physical model has obvious theoretical advantages, but is limited by factors such as complexity, data dependence, environmental changes and insufficient model adaptability. Statistical methods such as ARMA, ARIMA and MLR are used to process time series and nonlinear data, but they have limitations. Machine learning methods can handle complex nonlinear relationships and large amounts of data, adapt to different environmental changes and data characteristics, and have high accuracy. Common methods include DNN, SVM and RF. At present, the SVR, RF and LSTM models are used to improve the prediction accuracy. However, there is an overfitting problem in a single model, and the current method is mainly aimed at a single photovoltaic power station, without considering the mutual influence of multiple sites, resulting in low prediction accuracy. Summary of the invention
[0003] The present invention aims to at least solve the technical problem of low prediction accuracy in the prior art, and in particular innovatively proposes a time series data prediction system and method based on XGBOOST.
[0004] In order to achieve the above-mentioned object of the present invention, the present invention provides a time series data prediction system based on XGBOOST, the system comprising:
[0005] A collection module, used to collect power generation data of each power station;
[0006] A data receiving module, connected to the acquisition module, for receiving the power generation data;
[0007] A preprocessing module connected to the data receiving module, the preprocessing module includes a network construction unit and a model parameter initialization unit; the network construction unit is used to construct a mutual information network, and the model parameter initialization unit is used to initialize model parameters;
[0008] An execution module, connected to the network construction unit, for constructing training set data and labels using the mutual information network and power generation data, and training the XGBOOST power generation prediction model using the training set data, labels and loss function, and predicting the power generation of the power station using the XGBOOST power generation prediction model;
[0009] The storage module, together with the execution module and the preprocessing module, is used to store the power generation data, the mutual information network and the XGBOOST power generation prediction model.
[0010] As an optional embodiment of the present invention, optionally, the XGBOOST power generation prediction model includes:
[0011] A training error calculation unit, used to calculate the error of the last layer of the XGBOOST power generation prediction model using the label, and transfer the error using a back propagation algorithm;
[0012] An XGBOOST parameter optimization unit, used to calculate the gradient and second-order derivative of the current XGBOOST power generation prediction model, and to construct a plurality of decision trees using the gradient and second-order derivative, and to update the output of the XGBOOST power generation prediction model using the plurality of decision trees;
[0013] A model parameter iterative updating unit, which updates the parameters of the XGBOOST power generation prediction model based on the error using a gradient descent algorithm;
[0014] The training model output unit is used to send the XGBOOST power generation prediction model after training to the storage module.
[0015] As an optional embodiment of the present invention, optionally, the expression for constructing the mutual information network is:
[0016]
[0017] Among them, MI(;) represents the mutual information network constructed between sites, X and Y represent vectors constructed from the historical power generation data of two different sites, x represents the specific value of X, y represents the specific value of Y, p(x,y) represents the joint probability distribution of the specific value x and the specific value y, p(x) represents the marginal probability distribution of X to the specific value x, and p(y) represents the marginal probability distribution of Y to the specific value y.
[0018] As an optional embodiment of the present invention, optionally, constructing training set data and labels using the mutual information network and power generation data in the execution module includes:
[0019] Convolving the mutual information network to extract spatial features;
[0020] Extracting temporal features using an LSTM layer based on the spatial features;
[0021] The time series features are aligned with the power generation data to generate training set data and labels.
[0022] As an optional embodiment of the present invention, optionally, the expression for convolving the mutual information network is:
[0023]
[0024] Among them, f(,) represents the convolution operation, H (l) represents the input feature matrix of node l, A represents the adjacency matrix, σ(·) represents the activation function, represents the node degree matrix D plus the identity matrix I, represents the adjacency matrix A plus the identity matrix I, W (l) Represents the network parameter matrix of node l.
[0025] As an optional embodiment of the present invention, optionally, the expression for extracting time series features using the LSTM layer is:
[0026]
[0027] c(t)=f(t)·c(t-1)+i t ·g t
[0028]
[0029] Among them, f(t) represents the output of the forget gate at time t, σ(·) represents the activation function, represents the transpose of the forget gate weight, [,] represents the vector concatenation operation, h(t-1) represents the state of the hidden layer at time t-1, x(t) represents the input at time t, and b f represents the bias of the forget gate, i(t) represents the output of the input gate, represents the transpose of the input gate weight, b i represents the bias of the input gate, g(t) represents the output of the new memory gate, tanh(·) represents the hyperbolic tangent function, represents the transpose of the new memory gate weight, b g represents the bias of the new memory gate, c(t) represents the cell state at time t, c(t-1) represents the cell state at time t-1, i t represents the output of the input gate at time t, g t represents the output of the new memory gate at time t, o(t) represents the output of the output gate at time t, represents the transpose of the output gate weight, b o Represents the bias of the output gate.
[0030] As an optional embodiment of the present invention, optionally, the output of the XGBOOST power generation prediction model is the cumulative sum of outputs of several decision trees;
[0031] The output expression of the XGBOOST power generation prediction model is:
[0032]
[0033] in, represents the predicted value of the i-th sample, K represents the number of decision trees, k represents the k-th decision tree, and f k (x i ) represents the sample x i The output of the kth decision tree.
[0034] As an optional embodiment of the present invention, optionally, the expression of the loss function is:
[0035]
[0036] Among them, L(·) represents the total loss function of the model, φ represents the model parameters, i represents the i-th sample, l(,) represents the loss function of a single sample, The predicted value of the i-th sample, y i The true value of the i-th sample, k represents the k-th decision tree, Ω(f k ) represents the regularization term.
[0037] As an optional embodiment of the present invention, optionally, the training error calculation unit calculates the error expression as follows:
[0038]
[0039] Among them, MSE represents the error, N represents the number of samples in the batch, i represents the i-th sample, and y i The true value of the i-th sample, The predicted value of the i-th sample.
[0040] A time series data prediction method based on XGBOOST, the method comprising a time series data prediction system based on XGBOOST;
[0041] The method further comprises:
[0042] S1. Obtain power generation data of each power station;
[0043] S2. constructing a mutual information network based on the power generation data of each power station;
[0044] S3, convolve the mutual information network to extract spatial features, extract time series features based on the spatial features using the LSTM layer, align the time series features with the power generation data, and generate training set data and labels;
[0045] S4, constructing a loss function and an XGBOOST power generation prediction model, and using the loss function, training set data and labels to iteratively optimize and train the XGBOOST power generation prediction model;
[0046] S5. Determine whether the XGBOOST power generation prediction model converges;
[0047] If yes, the training process ends;
[0048] If not, the gradient and second-order derivative of the current XGBOOST power generation prediction model are calculated, and several decision trees are constructed using the gradient and second-order derivative, and the output of the XGBOOST power generation prediction model is updated using the several decision trees; the error of the last layer of the XGBOOST power generation prediction model is calculated using the label, and the error is transferred using the back propagation algorithm; the parameters of the XGBOOST power generation prediction model are updated using the gradient descent algorithm based on the error;
[0049] S6. Repeat step S5 until the XGBOOST power generation prediction model converges.
[0050] The beneficial effect of the present invention is that by constructing a mutual information network between power stations and performing convolution operations on the mutual information network, the spatial correlation features between power stations can be effectively extracted. At the same time, by processing the time series data in combination with the LSTM layer, the dynamic characteristics of the change in power generation can be captured. Through the integrated learning method of the XGBOOST model, not only the accuracy of the prediction is improved, but also the generalization ability of the model is enhanced. In addition, the loss function adopted by the present invention not only considers the difference between the predicted value and the true value, but also adds a regularization term, which effectively avoids the overfitting phenomenon and improves the prediction performance of the model on unknown data. The training error calculation unit can monitor the training process of the model in real time to ensure that the model is continuously optimized during the training process until convergence.
[0051] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0053] Figure 1 It is a schematic diagram of the structure of embodiment 1 of the present invention.
[0054] Figure 2 This is a flow chart of power generation data prediction in Example 1 of the present invention.
[0055] Figure 3This is a statistical chart comparing the prediction accuracy of time series data based on XGBOOST in Example 1 of the present invention.
[0056] Figure 4 This is a flow chart of Embodiment 2 of the present invention. DETAILED DESCRIPTION
[0057] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0058] Example 1
[0059] like Figure 1 As shown, a time series data prediction system based on XGBOOST, the system includes:
[0060] The collection module is used to collect the power generation data of each power station; the power generation data is the historical power generation data of the power station;
[0061] A data receiving module, connected to the acquisition module, for receiving the power generation data;
[0062] The data receiving module is a wireless communication module, which is connected to the acquisition module by wireless communication, receives the power generation data sent by the acquisition module in real time, and stores it in the storage module.
[0063] A preprocessing module connected to the data receiving module, the preprocessing module includes a network construction unit and a model parameter initialization unit; the network construction unit is used to construct a mutual information network, and the model parameter initialization unit is used to initialize model parameters;
[0064] The network construction unit is a mutual information network constructed based on the interactive information between power stations. The mutual information network can capture the spatial correlation characteristics between power stations. The model parameter initialization unit is responsible for setting the initial parameters of the XGBOOST model, laying the foundation for the subsequent training process. The initial parameters of the XGBOOST model include the encoding length of the GCN layer, the encoding length of the LSTM layer, the model learning rate, the learning rate of XGBOOST, the number of trees, and the number of iterations.
[0065] An execution module, connected to the network construction unit, for constructing training set data and labels using the mutual information network and power generation data, and training the XGBOOST power generation prediction model using the training set data, labels and loss function, and predicting the power generation of the power station using the XGBOOST power generation prediction model;
[0066] The training error calculation unit of the execution module uses the mutual information network data stored in the mutual information network storage unit in the data storage module to perform GCN convolution operations to extract the latent space features in the data and output the corresponding graph embedding representation, and then extract the time series features through LSTM, and obtain the representation at time t+1; the graph embedding representation and the power generation data stored in the power generation output storage unit in the data storage module are misplaced to form training data and labels, which are input into the XGBOOST parameter optimization unit to train the XGBOOST power generation prediction model to complete the XGBOOST power generation prediction model training. Then, the representation at time t+1 is input into the trained XGBOOST power generation prediction model to complete the power generation prediction and obtain the power generation prediction value; the predicted value and the true value label are input into the model parameter iterative update unit, the error between the true value and the predicted value is calculated, and the back propagation is completed through the gradient descent method to realize the iterative update of the model parameters; the training model output unit instructs the training model storage unit of the data storage module to store the trained prediction model.
[0067] The storage module, together with the execution module and the preprocessing module, is used to store the power generation data, the mutual information network and the XGBOOST power generation prediction model.
[0068] like Figure 1 As shown, the storage module includes a power generation data storage unit, a mutual information network storage unit and a training model storage unit. The power generation data storage unit is used to store power generation data, the mutual information network storage unit is used to store the mutual information network, and the training model storage unit is used to store the XGBOOST power generation prediction model.
[0069] like Figure 2 As shown, the system usage steps of this embodiment are:
[0070] (1) The system receives instructions from the server to perform time series data prediction based on XGBOOST.
[0071] (2) The system receives the photovoltaic power generation data set.
[0072] (3) The system preprocesses the power generation data to obtain a mutual information network.
[0073] (4) The system initializes the relevant parameters of the XGBOOST power generation prediction model.
[0074] (5) System construction objective function.
[0075] (6) The system determines whether the current training round has reached the convergence condition. If so, execute step (10); otherwise, execute step (7)
[0076] (7) The system performs training and optimization of the XGBOOST power generation prediction model.
[0077] (8) The system calculates the back-propagation error of the last layer.
[0078] (9) The system performs gradient descent to update the model parameters. And execute step (6)
[0079] (10) The system instructs the training model storage unit of the data storage module to store the trained prediction model.
[0080] In summary, this embodiment can effectively extract the spatial correlation features between power stations by constructing a mutual information network between power stations and performing convolution operations on the mutual information network. At the same time, by processing the time series data in combination with the LSTM layer, the dynamic characteristics of the change in power generation can be captured. Through the integrated learning method of the XGBOOST model, not only the accuracy of the prediction is improved, but also the generalization ability of the model is enhanced. In addition, the loss function adopted by the present invention not only considers the difference between the predicted value and the true value, but also adds a regularization term, which effectively avoids the overfitting phenomenon and improves the prediction performance of the model on unknown data. The training error calculation unit can monitor the training process of the model in real time to ensure that the model is continuously optimized during the training process until convergence.
[0081] As an optional embodiment of the present invention, optionally, the XGBOOST power generation prediction model includes:
[0082] A training error calculation unit, used to calculate the error of the last layer of the XGBOOST power generation prediction model using the label, and transfer the error using a back propagation algorithm;
[0083] It should be noted that the training error calculation unit is not only responsible for calculating the error, but also responsible for back-propagating the error to each level of the model in order to iteratively update the parameters. In this way, the model can gradually adjust its internal parameters to better fit the training data.
[0084] An XGBOOST parameter optimization unit, used to calculate the gradient and second-order derivative of the current XGBOOST power generation prediction model, and to construct a plurality of decision trees using the gradient and second-order derivative, and to update the output of the XGBOOST power generation prediction model using the plurality of decision trees;
[0085] It should be noted that the XGBOOST parameter optimization unit is not only responsible for optimizing model parameters, but also for building decision trees to improve the prediction accuracy of the model. By building multiple decision trees, the XGBOOST model is able to capture complex relationships in the data, thereby having higher accuracy and robustness when predicting power generation. The principle of the XGBOOST parameter optimization unit to optimize model parameters is to minimize the loss function, which measures the difference between the model's predicted value and the true value. During the optimization process, the XGBOOST parameter optimization unit calculates the gradient and second-order derivative of the loss function with respect to the model parameters, and then uses this information to adjust the model parameters to reduce the prediction error. By iteratively performing this process, the model parameters gradually converge to the optimal value, so that the model performs better and better on the training data.
[0086] A model parameter iterative updating unit, which updates the parameters of the XGBOOST power generation prediction model based on the error using a gradient descent algorithm;
[0087] It should be noted that the model parameter iteration update unit is the core part of the model training process. It is responsible for gradually adjusting the model parameters through the gradient descent method according to the calculated error, so that the performance of the model on the training data is gradually improved. The gradient descent method is a commonly used optimization algorithm. It calculates the gradient of the loss function with respect to the model parameters and updates the parameters in the opposite direction of the gradient, so that the value of the loss function gradually decreases. In each iteration, the model parameter iteration update unit adjusts the value of the model parameters according to the current gradient information in order to achieve the global minimum loss. Through continuous iteration, the model parameters gradually converge to the optimal solution, thereby improving the accuracy and reliability of the model in predicting power generation.
[0088] The training model output unit is used to send the XGBOOST power generation prediction model after training to the storage module.
[0089] As an optional embodiment of the present invention, optionally, the expression for constructing the mutual information network is:
[0090]
[0091] Among them, MI(;) represents the mutual information network constructed between sites;
[0092] X and Y represent vectors constructed from historical power generation data of two different stations;
[0093] x represents a specific value of X;
[0094] y represents a specific value of Y;
[0095] p(x,y) represents the joint probability distribution of a specific value x and a specific value y;
[0096] p(x) represents the marginal probability distribution of X to a specific value x;
[0097] p(y) represents the marginal probability distribution of Y to a specific value y.
[0098] The mutual information network is constructed based on the mutual information between power stations.
[0099] As an optional embodiment of the present invention, optionally, constructing training set data and labels using the mutual information network and power generation data in the execution module includes:
[0100] Convolving the mutual information network to extract spatial features;
[0101] Extracting temporal features using an LSTM layer based on the spatial features;
[0102] The time series features are aligned with the power generation data to generate training set data and labels.
[0103] It should be noted that the spatial features in the mutual information network can be effectively extracted through the convolution operation, which reflects the spatial correlation between different power plants. The convolution operation can capture the features in the local area, so that the model can better understand the interaction between power plants. The LSTM layer is good at capturing the long-distance dependencies in the time series data. By extracting the time series features through the LSTM layer, the model can better understand the dynamic characteristics of the power generation data over time. In the process of generating the training set data and labels, the extracted spatial features are offset and aligned with the power generation data to ensure that the model considers both spatial and temporal features when learning. The offset alignment method allows the model to learn information in both spatial and temporal dimensions during the training process, thereby improving the accuracy and robustness of the model in predicting power generation.
[0104] As an optional embodiment of the present invention, optionally, the expression for convolving the mutual information network is:
[0105]
[0106] Among them, f(,) represents the convolution operation;
[0107] H (l) Represents the input feature matrix of node l;
[0108] A represents the adjacency matrix;
[0109] σ(·) represents the activation function;
[0110] represents the node degree matrix D plus the identity matrix I;
[0111] represents the adjacency matrix A plus the identity matrix I;
[0112] W (l) Represents the network parameter matrix of node l.
[0113] As an optional embodiment of the present invention, optionally, the expression for extracting time series features using the LSTM layer is:
[0114]
[0115] c(t)=f(t)·c(t-1)+i t ·g t
[0116]
[0117] Among them, f(t) represents the output of the forget gate at time t;
[0118] σ(·) represents the activation function;
[0119] represents the transpose of the forget gate weight;
[0120] [,] represents vector concatenation operation;
[0121] h(t-1) represents the state of the hidden layer at time t-1;
[0122] x(t) represents the input at time t;
[0123] b f represents the bias of the forget gate;
[0124] i(t) represents the output of the input gate;
[0125] represents the transpose of the input gate weight;
[0126] b i represents the bias of the input gate;
[0127] g(t) represents the output of the new memory gate;
[0128] tanh(·) represents the hyperbolic tangent function;
[0129] represents the transpose of the new memory gate weight;
[0130] b g represents the bias of the new memory gate;
[0131] c(t) represents the cell state at time t;
[0132] c(t-1) represents the cell state at time t-1;
[0133] i t represents the output of the input gate at time t;
[0134] g t represents the output of the new memory gate at time t;
[0135] o(t) represents the output of the output gate at time t;
[0136] represents the transpose of the output gate weight;
[0137] b o Represents the bias of the output gate.
[0138] As an optional embodiment of the present invention, optionally, the output of the XGBOOST power generation prediction model is the cumulative sum of outputs of several decision trees;
[0139] The output expression of the XGBOOST power generation prediction model is:
[0140]
[0141] in, Represents the predicted value of the i-th sample;
[0142] K represents the number of decision trees;
[0143] k represents the kth decision tree;
[0144] f k (x i ) represents the sample x i The output of the kth decision tree.
[0145] It should be noted that the final output of the XGBOOST power generation prediction model is the cumulative sum of the outputs of multiple decision trees, and the contribution of each decision tree is controlled by the learning rate. This strategy enables it to improve prediction performance by integrating multiple decision trees, and has high generalization ability. Among them, XGBOOST is an integrated learning method that improves prediction performance by building multiple decision trees. During the training process, XGBOOST iteratively adds new trees, and each tree is optimized based on the previous tree to reduce the prediction error. In this way, XGBOOST is able to build a model containing multiple decision trees, thereby predicting the complex relationships of the data.
[0146] As an optional embodiment of the present invention, optionally, the expression of the loss function is:
[0147]
[0148] Among them, L(·) represents the total loss function of the model;
[0149] φ represents the model parameters;
[0150] i represents the i-th sample;
[0151] l(,) represents the loss function of a single sample;
[0152] The predicted value of the i-th sample;
[0153] y i The true value of the i-th sample;
[0154] k represents the kth decision tree;
[0155] Ω(f k ) represents the regularization term.
[0156] It should be noted that the loss function is an important tool for measuring the difference between the model prediction value and the true value. In the present invention, the loss function is used to guide the training process of the model, ensuring that the model can learn the effective information in the data while avoiding the occurrence of overfitting. By optimizing the loss function, the model can continuously adjust its parameters to achieve the purpose of minimizing the prediction error. The loss function of this embodiment not only takes into account the difference between the predicted value and the true value, but also adds a regularization term, which effectively avoids the overfitting phenomenon and improves the prediction performance of the model on unknown data.
[0157] As an optional embodiment of the present invention, optionally, the training error calculation unit calculates the error expression as follows:
[0158]
[0159] Among them, MSE represents the error;
[0160] N represents the number of samples in the batch;
[0161] i represents the i-th sample;
[0162] y i The true value of the i-th sample;
[0163] The predicted value of the i-th sample.
[0164] In this embodiment, the performance of the above-mentioned time series data prediction system based on XGBOOST is verified as an example. This embodiment installs the device on a PC (configuration: INTEL i7-13700, 2.10GHz processor, 32G memory), and runs a simulation experiment for example analysis. In the example analysis, the photovoltaic power generation data used comes from the photovoltaic power generation data set of a national renewable energy laboratory. The example analysis uses MSE as an evaluation index for the accuracy of photovoltaic power generation prediction. The lower the MSE, the higher the accuracy of photovoltaic power generation prediction.
[0165] Figure 3 After applying the embodiment of the present invention, the power generation of the photovoltaic power station is predicted in a single step, and the prediction accuracy is compared with that of the CNN, LSTM, XGBOOST and TCN models; Figure 3 As shown in the figure, the photovoltaic power generation in the next 10 days is predicted. In most cases, the prediction error of this application is lower than that of other comparison models, which shows that this application has better prediction effect, improves the accuracy of the model under various complex environmental conditions, and provides more effective guarantee for practical application.
[0166] It can be seen from the above technical solution that the embodiment of the present invention provides a time series data prediction system based on XGBOOST, which acts on photovoltaic power generation data, can take into account the mutual influence between multiple photovoltaic power stations and the influence of meteorological factors on power generation, improve the accuracy and flexibility of the model under various complex environmental conditions, and provide more reliable prediction results for practical applications.
[0167] Example 2
[0168] A time series data prediction method based on XGBOOST, the method comprising a time series data prediction system based on XGBOOST;
[0169] The method further comprises:
[0170] S1. Obtain the power generation data of each power station; the power generation data of all power stations in the geographical location specified by each power station includes historical power generation, meteorological data, equipment status and other information. These data are obtained through sensors, databases or other data sources.
[0171] S2. constructing a mutual information network based on the power generation data of each power station;
[0172] S3, convolve the mutual information network to extract spatial features, extract time series features based on the spatial features using the LSTM layer, align the time series features with the power generation data, and generate training set data and labels;
[0173] S4, constructing a loss function and an XGBOOST power generation prediction model, and using the loss function, training set data and labels to iteratively optimize and train the XGBOOST power generation prediction model;
[0174] S5. Determine whether the XGBOOST power generation prediction model converges;
[0175] If yes, the training process ends;
[0176] If not, the gradient and second-order derivative of the current XGBOOST power generation prediction model are calculated, and several decision trees are constructed using the gradient and second-order derivative, and the output of the XGBOOST power generation prediction model is updated using the several decision trees; the error of the last layer of the XGBOOST power generation prediction model is calculated using the label, and the error is transferred using the back propagation algorithm; the parameters of the XGBOOST power generation prediction model are updated using the gradient descent algorithm based on the error;
[0177] S6. Repeat step S5 until the XGBOOST power generation prediction model converges.
[0178] like Figure 4 As shown, it should be noted that Example 2 first obtains the power generation data of each power station, which provides a basis for the subsequent mutual information network construction and feature extraction. The construction of the mutual information network can reveal the relationship between different power stations, so as to better capture the spatial features. By performing convolution operations on the mutual information network, spatial features can be effectively extracted, which are crucial for understanding the distribution and mutual influence of power generation.
[0179] In step S3, the spatial features are embedded and then input into the LSTM layer to extract the time series features. The extracted time series features are aligned with the original power generation data to generate training set data and labels. This method of offset alignment helps the model learn the time series features in the time series data, so as to better predict the time series. By combining spatial features and time series features, the model can more comprehensively capture the various factors that affect power generation.
[0180] In step S4, a loss function and an XGBOOST power generation prediction model are constructed, and the model is iteratively optimized and trained using the loss function, training set data, and labels. The introduction of the loss function ensures that the model can continuously adjust parameters during the training process to minimize the prediction error. The iterative optimization training process of the XGBOOST model can gradually improve the prediction performance of the model, making it more accurate and robust under various complex environmental conditions.
[0181] In step S5, the training process is terminated by judging whether the XGBOOST power generation prediction model has converged. If the model has not converged, the gradient and second-order derivative of the current model are calculated, and a new decision tree is constructed using this information to update the model output. By calculating the error of the last layer and transferring the error using the back propagation algorithm, the model parameters can be further optimized to improve the prediction accuracy of the model.
[0182] In step S6, step S5 is repeated until the model converges. This process ensures that the model can be continuously iterated and optimized during the training process, and finally achieves a relatively ideal prediction effect. In this way, it can be ensured that the model has high accuracy and reliability when facing practical applications.
[0183] like Figure 4 As shown, the flowchart of Example 2 clearly shows the steps and processes of the entire prediction method. Starting from acquiring power generation data, to building a mutual information network, extracting spatial features, generating training set data and labels, to building a loss function and XGBOOST model and performing iterative optimization training, and finally judging whether the model has converged and updating it accordingly, the entire process is closely linked to ensure efficient training and high-precision prediction of the model. In this way, a reliable and efficient solution can be provided for photovoltaic power generation prediction.
[0184] Although the 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 the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
Claims
1. A time series data prediction system based on XGBOOST, characterized in that: The system comprises: A collection module, used to collect power generation data of each power station; A data receiving module, connected to the acquisition module, for receiving the power generation data; A preprocessing module connected to the data receiving module, the preprocessing module includes a network construction unit and a model parameter initialization unit; the network construction unit is used to construct a mutual information network, and the model parameter initialization unit is used to initialize model parameters; An execution module, connected to the network construction unit, for constructing training set data and labels using the mutual information network and power generation data, and training the XGBOOST power generation prediction model using the training set data, labels and loss function, and predicting the power generation of the power station using the XGBOOST power generation prediction model; The storage module, together with the execution module and the preprocessing module, is used to store the power generation data, the mutual information network and the XGBOOST power generation prediction model.
2. A time series data prediction system based on XGBOOST as claimed in claim 1, characterized in that: The XGBOOST power generation prediction model includes: A training error calculation unit, used to calculate the error of the last layer of the XGBOOST power generation prediction model using the label, and transfer the error using a back propagation algorithm; An XGBOOST parameter optimization unit, used to calculate the gradient and second-order derivative of the current XGBOOST power generation prediction model, and to construct a plurality of decision trees using the gradient and second-order derivative, and to update the output of the XGBOOST power generation prediction model using the plurality of decision trees; A model parameter iterative updating unit, which updates the parameters of the XGBOOST power generation prediction model based on the error using a gradient descent algorithm; The training model output unit is used to send the XGBOOST power generation prediction model after training to the storage module.
3. A time series data prediction system based on XGBOOST as claimed in claim 1, characterized in that: The expression for constructing the mutual information network is: Among them, MI(;) represents the mutual information network constructed between sites, X and Y represent vectors constructed from the historical power generation data of two different sites, x represents the specific value of X, y represents the specific value of Y, p(x,y) represents the joint probability distribution of the specific value x and the specific value y, p(x) represents the marginal probability distribution of X to the specific value x, and p(y) represents the marginal probability distribution of Y to the specific value y.
4. A time series data prediction system based on XGBOOST as claimed in claim 1, characterized in that: Using the mutual information network and power generation data to construct training set data and labels in the execution module includes: Convolving the mutual information network to extract spatial features; Extracting temporal features using an LSTM layer based on the spatial features; The time series features are aligned with the power generation data to generate training set data and labels.
5. A time series data prediction system based on XGBOOST as claimed in claim 4, characterized in that: The expression for convolution of the mutual information network is: Among them, f(,) represents the convolution operation, H (l) represents the input feature matrix of node l, A represents the adjacency matrix, σ(·) represents the activation function, represents the node degree matrix D plus the identity matrix I, represents the adjacency matrix A plus the identity matrix I, W (l) Represents the network parameter matrix of node l.
6. A time series data prediction system based on XGBOOST as claimed in claim 4, characterized in that: The expression for extracting time series features using the LSTM layer is: c(t)=f(t)·c(t-1)+i t ·g t Among them, f(t) represents the output of the forget gate at time t, σ(·) represents the activation function, represents the transpose of the forget gate weight, [,] represents the vector concatenation operation, h(t-1) represents the state of the hidden layer at time t-1, x(t) represents the input at time t, and b f represents the bias of the forget gate, i(t) represents the output of the input gate, represents the transpose of the input gate weight, b i represents the bias of the input gate, g(t) represents the output of the new memory gate, tanh(·) represents the hyperbolic tangent function, represents the transpose of the new memory gate weight, b g represents the bias of the new memory gate, c(t) represents the cell state at time t, c(t-1) represents the cell state at time t-1, i t represents the output of the input gate at time t, g t represents the output of the new memory gate at time t, o(t) represents the output of the output gate at time t, represents the transpose of the output gate weight, b o Represents the bias of the output gate.
7. A time series data prediction system based on XGBOOST as claimed in claim 2, characterized in that: The output of the XGBOOST power generation prediction model is the cumulative sum of the outputs of several decision trees; The output expression of the XGBOOST power generation prediction model is: in, represents the predicted value of the i-th sample, K represents the number of decision trees, k represents the k-th decision tree, and f k (x i ) represents the sample x i The output of the kth decision tree.
8. A time series data prediction system based on XGBOOST as claimed in claim 1, characterized in that: The expression of the loss function is: Among them, L(·) represents the total loss function of the model, φ represents the model parameters, i represents the i-th sample, l(,) represents the loss function of a single sample, The predicted value of the i-th sample, y i The true value of the i-th sample, k represents the k-th decision tree, Ω(f k ) represents the regularization term.
9. The time series data prediction system based on XGBOOST according to claim 1, characterized in that: The training error calculation unit calculates the error expression as follows: Among them, MSE represents the error, N represents the number of samples in the batch, i represents the i-th sample, and y i The true value of the i-th sample, The predicted value of the i-th sample.
10. A time series data prediction method based on XGBOOST, characterized in that: The method comprises a time series data prediction system based on XGBOOST as described in claims 1 to 9; The method further comprises: S1. Obtain power generation data of each power station; S2. constructing a mutual information network based on the power generation data of each power station; S3, convolve the mutual information network to extract spatial features, extract time series features based on the spatial features using the LSTM layer, align the time series features with the power generation data, and generate training set data and labels; S4, constructing a loss function and an XGBOOST power generation prediction model, and using the loss function, training set data and labels to iteratively optimize and train the XGBOOST power generation prediction model; S5. Determine whether the XGBOOST power generation prediction model converges; If yes, the training process ends; If not, the gradient and second-order derivative of the current XGBOOST power generation prediction model are calculated, and several decision trees are constructed using the gradient and second-order derivative, and the output of the XGBOOST power generation prediction model is updated using the several decision trees; the error of the last layer of the XGBOOST power generation prediction model is calculated using the label, and the error is transferred using the back propagation algorithm; the parameters of the XGBOOST power generation prediction model are updated using the gradient descent algorithm based on the error; S6. Repeat step S5 until the XGBOOST power generation prediction model converges.
Citation Information
Cited By
Structured information source semantic transmission method and system for power wireless communication and storage medium
CN120751019A
Structured source semantic transmission method, system and storage medium for power wireless communication
CN120751019B
Cross-oilfield collaborative petroleum yield prediction method based on federated learning
CN121480810A
Simulation running time prediction method and system, storage medium and program product
CN121638083A
