## 3 Methods  
With growing global concern for climate change, the power generation industry, as a major source of carbon emissions, has attracted widespread attention regarding the relationship between electricity consumption in production activities and carbon emissions. The study aims to establish a highly accurate electricity-carbon relationship prediction model by analyzing the production and carbon emission data from 25 coal-fired power generation enterprises and employing the Optuna-optimized LightGBM [27] and XGBoost [28] algorithms. This model not only improves prediction accuracy and robustness, but also offers an effective solution for \"measuring carbon through electricity\", creating a new path that is different from the commonly used emission factor method in China. In this study, a comprehensive collection and exploratory analysis of data from 25 coal-fired power generation enterprises were first conducted, focusing on the types and sizes of generating units and related monthly indicators such as electricity generation, power supply, heating supply, and carbon emissions. Data preprocessing included handling missing values, eliminating outliers, and selecting features to ensure the quality and applicability of the data. Unit data from power generation companies were processed into structured tabular data, and a parallel processing framework was simultaneously constructed with LightGBM and XGBoost. In this framework, hyperparameters are optimized by the Optuna algorithm [29]. The multilayer perceptron (MLP) [30] is used to fuse features to enhance prediction accuracy by capturing characters that individual models cannot detect. The electricity-carbon nexus Optuna-LightGBM-XGBoost model is shown in Figure 1.  
LightGBM and XGBoost are gradient boosting frameworks that are widely known for their efficiency and effectiveness in handling large-scale data. LightGBM optimizes the traditional gradient boosting decision tree (GBDT) using a histogram-based algorithm for faster training and lower memory usage. XGBoost, on the other hand, provides a regularized model formalization to control over-fitting, which is crucial for predictive accuracy. LightGBM and XGBoost are widely used in various machine learning tasks due to their efficient processing speeds and excellent predictive performance. Optuna is an automated hyperparameter optimization framework that intelligently explores the best combination of hyperparameters by defining the search space and optimization objectives, thereby improving the model's prediction accuracy and robustness. For LightGBM, the selected hyperparameters for tuning included learning_rate, max_depth, n_estimators, num_leaves, and min_child_samples. The search range for Optuna-LightGBM hyperparameters is shown in Table 1. For XGBoost, the selected hyperparameters for tuning included learning_rate, max_depth, n_estimators, and subsample. The search range for Optuna-XGBoost hyperparameters is shown in Table 2.  
After conducting hyperparameter tuning with Optuna, based on the search ranges in Tables 1 and 2, the optimal parameters obtained for LightGBM and XGBoost are shown in Table 3 and Table 4, respectively. After the hyperparameter tuning was completed, to enhance the accuracy of the predictions and to integrate the strengths of the optimized XGBoost and LightGBM models, we employed a multilayer perceptron (MLP) as a model fusion tool. The motivation behind this method is to leverage the nonlinear learning capabilities of the MLP to learn and integrate the complex relationships between the prediction results of the two gradient boosting tree-based models. By fusing the prediction results of XGBoost and LightGBM as new feature inputs into the MLP, we expect this combined model to capture data patterns that individual models cannot detect, thereby improving the overall predictive performance. By integrating the LightGBM and XGBoost models, we were able to combine the strengths of these two powerful gradient boosting frameworks.