Bayesian Optimized XGBoost Regression with SHAP Feature Interpretation Code
收藏资源简介:
This repository contains the complete Python code used for the Bayesian optimized XGBoost model and SHapley Additive exPlanations (SHAP) model in the manuscript Analysis of the Global and Local Effects of Urban Green Space Vegetation Types on Summer Near-Surface O₃ Concentrations Based on Street View Imagery—A Case Study of Hangzhou. The main functionalities of the code include: Data preprocessing and train/validation/test set splitting Hyperparameter tuning of the XGBoost model via Bayesian optimization Model performance evaluation using regression metrics (R², MSE, RMSE, MAE, MAPE, EVS) SHAP feature importance analysis, including summary plots and feature contribution bar charts Environment and Dependencies: Operating System: Windows / macOS / Linux Python version: 3.8 or higher Required Python packages: - numpy - pandas - matplotlib - seaborn - scikit-learn - xgboost - bayesian-optimization - shap - tabulate Instructions to Run the Code: Prepare the CSV-formatted dataset and ensure no missing values. Update the data path in the code to your actual file path. Place the data file in the same directory as the script. Run the Python script directly. All generated figures will be automatically saved in the output_plots folder after execution.



