In order to accurately and efficiently characterize the spatial distribution characteristics of porosity in tight oil reservoirs and evaluate the interpretability of machine learning models,the Z-Score method was used to normalize the feature attributes,and the Optuna hyperparameter optimization framework was applied to optimize the hyperparameters of the model. A porosity prediction model based on the LightGBM algorithm was established,and the prediction performance was comprehensively compared with GBDT and XGBoost algorithm models. The SHAP algorithm was used to visually interpret and analyze the output results of the LightGBM model. The research results indicate that the LightGBM model has prediction determination coefficients of 0.984 and 0.855 on the training and testing datasets,respectively. The model has high prediction accuracy and strong generalization ability,and its overall prediction performance is better than the GBDT and XGBoost models. The interpretability of the LightGBM model results was analyzed by using the SHAP algorithm. The results show that the five most important logging parameters affecting the LightGBM porosity prediction model are density,array induction resistivity,natural gamma,interval transit time,and photoelectric absorption cross-section index. In the porosity prediction example of X tight interval of a single well in the research area,the LightGBM model achieves a prediction accuracy of 93.9%,which is higher than the prediction accuracy of the GBDT and XGBoost models at 86.53% and 89.08%,respectively. The training duration is 0.016 s,which is 0.096 times and 0.025 times the training duration of GBDT and XGBoost models,respectively. The prediction duration is 0.01 s,which is 0.42 times and 0.19 times the prediction duration of GBDT and XGBoost models,respectively. The prediction efficiency of the LightGBM model has significant advantages over the GBDT and XGBoost models. The LightGBM model has smaller prediction errors for porosity in the cored interval,stronger prediction ability,and can better fit low porosity values. This method could solve the problem of obtaining complete and accurate porosity distribution in single well tight intervals and improve the accuracy and efficiency of porosity prediction,which has a certain reference value for the evaluation and efficient exploration and development of tight oil reservoirs.