###### Abstract  
The prediction and distribution of reservoir porosity and permeability are of paramount importance for the exploration and development of regional oil and gas resources. In order to optimize the prediction methods of porosity and permeability and better guide gas field development, it is necessary to identify the most effective approaches. Therefore, based on the extreme gradient boosting (XGBoost) algorithm, laboratory test data of the porosity and permeability of cores from the southern margin of the Ordos Basin were selected as the target labels, conventional logging curves were used as the input feature variables, and the mean absolute error (MAE) and the coefficient of determination (R\({}^{2}\)) were used as the evaluation indicators. Following the selection of the optimal feature variables and optimization of the hyper-parameters, an XGBoost porosity and permeability prediction model was established. Subsequently, the innovative application of homogeneous clustering (K-means) data preprocessing was applied to enhance the XGBoost model's performance. The results show that logarithmically preprocessed (LOG(PERM)) target labels enhanced the performance of the XGBoost permeability prediction model, with an increase of 0.26 in its test set R\({}^{2}\). Furthermore, the application of K-means improved the performance of the XGBoost prediction model, with an increase of 0.15 in the R\({}^{2}\) of the model and a decrease of 0.017 in the MAE. Finally, the POR_0/POR_1 grouped porosity model was selected as the final predictive model for porosity in the study area, and the Arctan(PERM)_0/Arctan(PERM0)_1 grouped model was selected as the final predictive model for permeability, which has better prediction accuracy than logging curves. The combination of K-means and the XGBoost modeling method provides a new approach and reference for the efficient and relatively accurate evaluation of porosity and permeability in the study area. XGBoost; K-means; porosity and permeability prediction model +
Footnote †: journal: Applied Sciences  
is more accurate in characterizing micropores than other techniques [3]. In sandstone reservoirs with predominantly medium porosity distribution (2-50 nm), the use of the low-temperature nitrogen (N\({}_{2}\)) adsorption method is a more common approach for porosity determination [4; 5; 6; 7]. Some scholars have applied constant-rate mercury injection technology to measure porosity in tight porous sandstone reservoirs. The constant-rate mercury injection method measures porosity with the unique advantage of an extremely low and constant injection rate of mercury [8; 9]. Based on the variation of mercury injection rate with pressure, further research is conducted on the pore structure parameters of reservoir rocks [10]. [PERSON] et al. (2020) and [PERSON] et al. (2012) [11; 12] applied nuclear magnetic resonance radiography to characterize pore diameters from 2 nm to 1000 nm. The processing and interpreting relaxation time data and its indirect conversion to porosity values had the advantages of not damaging the core and having high speed, high accuracy, and strong experimental operability, making it one of the important tools for reservoir evaluation and exploration engineering in oil and gas reservoirs. Therefore, the range of porosity measurement varies between different methods, and a single method cannot fully measure the pore characteristics of the reservoir. Multiple methods must be combined to quantitatively characterize the reservoir porosity. In contrast, permeability laboratory measurements are mainly conducted through gas measurement. According to [PERSON]'s law of fluids, when the gas reaches a steady state, the permeability parameters of the rock core are calculated, and the test results are more accurate [13; 14]. In oil and gas production sites, permeability testing is mainly applied through methods, such as well testing and oil and gas production, in order to provide true formation permeability. The cost of testing methods is relatively higher [15; 16].