Extracting spatial effects from machine learning model using local interpretation method: An example of SHAP and XGBoost

Ziqi Li

Computers Environment and Urban Systems · 2022 · 1K citations · 48 references

DOIFull text

Open access

Concepts

TL;DR

Machine learning and AI are becoming more interpretable thanks to advances in explainable AI, and local methods such as SHAP enable flexible modeling, interpretation, and visualization of complex geographical phenomena. This study demonstrates how SHAP can extract spatial effects from XGBoost models, using both simulation experiments and a Chicago ride‑hailing case study. The authors compare SHAP‑explainable XGBoost to Spatial Lag and Multi‑scale Geographically Weighted Regression at the parameter level in simulations, and then apply the same approach to real ride‑hailing data. SHAP‑explainable XGBoost reproduces spatial effects comparable to SLM and MGWR and performs better when nonlinearities, interactions, and unknown spatial patterns coexist.

Abstract

Machine learning and artificial intelligence (ML/AI), previously considered black box approaches, are becoming more interpretable, as a result of the recent advances in eXplainable AI (XAI). In particular, local interpretation methods such as SHAP (SHapley Additive exPlanations) offer the opportunity to flexibly model, interpret and visualise complex geographical phenomena and processes. In this paper, we use SHAP to interpret XGBoost (eXtreme Gradient Boosting) as an example to demonstrate how to extract spatial effects from machine learning models. We conduct simulation experiments that compare SHAP-explained XGBoost to Spatial Lag Model (SLM) and Multi-scale Geographically Weighted Regression (MGWR) at the parameter level. Results show that XGBoost estimates similar spatial effects as those in SLM and MGWR models. An empirical example of Chicago ride-hailing modelling is presented to demonstrate the utility of SHAP with real datasets. Examples and evidence in this paper suggest that locally interpreted machine learning models are good alternatives to spatial statistical models and perform better when complex spatial and non-spatial effects (e.g. non-linearities, interactions) co-exist and are unknown.

References

48