## 2 Method
### Machine Learning Modeling  
For machine learning (ML) training, a larger dataset is needed to enhance the training process and improve model accuracy. Previous studies have demonstrated the benefits of utilizing more extensive datasets [56]. To address this limitation, this study uses the Latin Hypercube Sampling (LHS) method to generate the sample space [57]. LHS is a stratified sampling method commonly applied in Monte Carlo simulations and is recognized as a powerful technique for producing small yet statistically representative samples. Compared to random sampling, LHS achieves the same level of statistical accuracy with a smaller sample size [58]. It has been extensively used to establish simulation case databases for validating machine learning models, particularly in residential building energy optimization [59] and building energy retrofitting [10; 60].  
For building optimization, the sample size required for LHS is typically ten times the number of design variables, influenced by the complexity of the interactions between these variables [46]. This size is considered sufficient if the probability density function stabilizes toward uniformity, effectively representing the entire building library. This study determined a sample size of 1000 cases based on the number of design variables and their interactions. The LHS method generated a matrix that effectively represents diverse building configurations. These configurations were then simulated to populate the database used in the machine learning model. To train and validate the machine learning model, the dataset was split into two subsets: 80% of the sample was used for training, and 20% was reserved for validation. The training step involved optimizing the model's weighting biases to improve predictive accuracy, while validation ensured the robustness and reliability of the model's predictions.  
To ensure a comprehensive analysis, four different ML models were compared: fast random forest (FRF), light gradient boosting machine (LightGBM), multivariate linear regression (MVLR), and artificial neural network (ANN). These models were selected due to their widespread use in predictive modeling and optimization tasks, as well as their potential to perform well in energy performance prediction for building retrofits. The performance of each model was evaluated using four statistical indicators: the coefficient of determination (R2), root mean square error (RMSE), mean square error (MSE), and mean absolute error (MAE). These metrics provide insights into the accuracy of predictions from different perspectives.  
R2 measures the proportion of variance in the dependent variable explained by the model. Higher values indicate better model performance.  
RMSE quantifies the standard deviation of residuals, representing the average distance between the predicted and actual values. Smaller values indicate better predictions.  
MSE calculates the average of squared differences between the predicted and actual values, with smaller values reflecting better accuracy.  
MAE assesses the average magnitude of prediction errors, with lower values indicating smaller prediction errors.  
By combining these indicators, the study ensures a rigorous evaluation of each model's accuracy, efficiency, and overall performance. The formulas for calculating these metrics are as follows:  
\[R^{2}=1-\frac{\sum_{i=1}^{n}(y_{i}-\hat{y}_{i})^{2}}{\sum_{i=1}^{n}(y_{i}- \bar{y})^{2}} \tag{9}\]  
\[RMSE=\sqrt{\frac{\sum_{i=1}^{n}(y_{i}-\hat{y}_{i})^{2}}{n}} \tag{10}\]  
\[MSE=\frac{\sum_{i=1}^{n}(y_{i}-\hat{y}_{i})^{2}}{n} \tag{11}\]  
\[MAE=\frac{\sum_{i=1}^{n}|y_{i}-\hat{y}_{i}|}{n} \tag{12}\]  
where n denotes the number of samples, i represents the number of case studies in the cluster, \(y_{i}\) denotes the actual value of a sample, \(\hat{y}_{i}\) represents the predicted value of a sample, and \(\overline{y}\) represents the mean of the actual values.