SQL with causal inference and counterfactual reasoning for explainable analytics

Loading...
Thumbnail Image

Date

2025-04

Journal Title

Journal ISSN

Volume Title

Publisher

University of New Brunswick

Abstract

This thesis presents a novel framework that integrates causal inference and counterfactual reasoning directly into SQL so that domain experts with minimal programming skills can solve real-world problems. Following SQL’s original purpose of empowering data querying, our approach extends it with intuitive causal keywords to enable advanced analysis using simple queries. The framework utilizes meta-learners and uplift modeling to learn treatment effects facilitate decision-making across domains. To generate counterfactuals, it combines KD-Trees for accurate neighbor search in low-dimensional data and distributed Locality Sensitive Hashing (LSH) for high-dimensional matching. This hybrid method ensures diverse, causally valid and interpretable counterfactuals by retrieving similar cases from distinct clusters. These counterfactuals improve the explainability by clarifying the effects of the intervention and model behavior. By merging causal modeling with accessible SQL syntax, our system bridges domain knowledge and machine learning, enabling transparent, scalable, and explainable decision support.

Description

Keywords

Citation