# A Small-Sample Scenario Optimization Scheduling Method Based on Multidimensional Data Expansion
## 3 XGBoost PV Power Prediction Method Considering Data Imbalance in Small-Sample Scenarios  
This paper employs the current mainstream XGBoost algorithm for photovoltaic power prediction [29; 30; 31]. Due to the limited actual operation data in the expanded dataset, an imbalance phenomenon occurred in the samples. Therefore, we oversampled the original real data. By duplicating and expanding a small amount of real data, the ratio of real data to expanded data became 1:1, prioritizing recent patterns and improving the prediction's accuracy under the condition of stable weather changes in the short term. The specific process is shown in Figure 2. The orange part represents the actual data, while the blue part represents the expanded data. Let the sample size of the original real data and the sample size of the expanded data be \(N_{real}\) and \(N_{syn}\), respectively. Replicate k copies of the actual output portion of the completed output data obtained from the expansion to obtain the amount of real data after oversampling is equal to the sample size of the expanded data, i.e., \(N^{\prime}_{real}=k\cdot N_{real}\). If \(N_{real}\) is not an integer multiple of \(N_{syn}\), equilibrium can be achieved by random sampling or partial replication. Figure 2: Schematic diagram of oversampling. Based on the prediction principle of XGBoost, all features are predicted via the input of Equation (10). Let the time series dataset, including PV output data and influencing factors, be \(\mathcal{D}=\{(X_{t},y_{t})\}_{t=1}^{T}\), where \(X=[x_{1},x_{2},\ldots,x_{n}]\) denotes the input feature vector at time \(t\), including historical PV output features and meteorological observation features, i.e., the input quantity. \(y_{t}\) denotes the load value at time \(t\), i.e., the output quantity. This paper's historical PV output characteristics consider the first hour's power, the first two hours' power, and the first three hours' sliding average power. On the other hand, meteorological characteristics are the main influencing factors affecting PV output determined by the correlation coefficient method. The XGBoost model is based on the Gradient Boosting Decision Tree (GBDT) algorithm. The Gradient Boosting algorithm is an integrative learning method. Figure 3 shows the framework of the XGBoost algorithm, which iteratively trains a weak learner (usually a decision tree CART), corrects the residuals of the previous round in each round, and utilizes the gradient descent to minimize the loss function while introducing the learning rate and regularization term to control the model complexity and, finally, build a powerful integrated model. In XGBoost, each leaf node has a weight, also known as leaf weight, which is the predicted value of the data corresponding to that leaf node. The leaf weight represents the regression take of all the samples in that tree at this leaf node. When there are multiple trees, the predictions of all trees are weighted and summed to obtain the final prediction, which the following equation can express:  
\[\hat{y}_{i}=\sum_{k}^{K}f_{k}(X_{i}) \tag{10}\]  
where \(f_{k}\) is the prediction function of the \(k\)-th tree, \(X_{i}\) indicates the input features at time \(i\), and \(\hat{y}_{i}\) denotes the prediction result of the \(k\)-th tree. The XGBoost model can discover the complex nonlinear statistical relationship between the target model and the observed features by combining weak learners and complexity control iteratively and gradually optimizing the model to improve the performance during the training process. Combined with the prediction results in Equation (6), the objective function of the XGBoost model is:  
\[O_{\text{bj}}=\sum_{t=1}^{M}l(y_{i},\hat{y}_{i})+\sum_{k=1}^{K}\Omega(f_{k}) \tag{11}\]  
\[\Omega(f_{k})=\gamma T+\frac{1}{2}\lambda\sum_{k=1}^{K}\omega_{k}^{2} \tag{12}\]  
Figure 3: XGBoost algorithm framework.