Table of Contents
Fetching ...

Explaining Categorical Feature Interactions Using Graph Covariance and LLMs

Cencheng Shen, Darren Edge, Jonathan Larson, Carey E. Priebe

TL;DR

This work tackles the challenge of analyzing large temporal categorical data, using the Counter-Trafficking Data Collaborative (CTDC) as a case study, by introducing a fast, scalable graph covariance approach on one-hot encoded features. The method yields a consistent dependence measure for binary variables, enabling efficient detection of evolving interactions via per-time covariances $\Sigma_t(u,v)$ and a simple significance rule, with two complementary pair-sets $\Delta_1$ (common interactions) and $\Delta_2$ (spikes). Theoretical guarantees are provided: $\Sigma_t(u,v) \to \mu_t = P(X_{u_t}=1,X_{v_t}=1) - P(X_{u_t}=1)P(X_{v_t}=1)$ and $\sqrt{n_t}(\Sigma_t(u,v)-\mu_t) \to N(0, \sigma_t^2)$ with $\sigma_t^2 \le 1/4 + 1/(16\sqrt{n_t})$, and independence iff $\mu_t=0$, with a p-value approximation via $\mathcal{N}(0,0.25)$. The framework achieves remarkable speed ($O(n p_1)$) and is paired with LLMs to generate data-driven narratives for detected interactions. In the CTDC application, the pipeline identifies meaningful interactions and yields interpretable explanations from LLMs, illustrating its utility for rapid, narrative-driven exploration of large temporal categorical datasets.

Abstract

Modern datasets often consist of numerous samples with abundant features and associated timestamps. Analyzing such datasets to uncover underlying events typically requires complex statistical methods and substantial domain expertise. A notable example, and the primary data focus of this paper, is the global synthetic dataset from the Counter Trafficking Data Collaborative (CTDC) -- a global hub of human trafficking data containing over 200,000 anonymized records spanning from 2002 to 2022, with numerous categorical features for each record. In this paper, we propose a fast and scalable method for analyzing and extracting significant categorical feature interactions, and querying large language models (LLMs) to generate data-driven insights that explain these interactions. Our approach begins with a binarization step for categorical features using one-hot encoding, followed by the computation of graph covariance at each time. This graph covariance quantifies temporal changes in dependence structures within categorical data and is established as a consistent dependence measure under the Bernoulli distribution. We use this measure to identify significant feature pairs, such as those with the most frequent trends over time or those exhibiting sudden spikes in dependence at specific moments. These extracted feature pairs, along with their timestamps, are subsequently passed to an LLM tasked with generating potential explanations of the underlying events driving these dependence changes. The effectiveness of our method is demonstrated through extensive simulations, and its application to the CTDC dataset reveals meaningful feature pairs and potential data stories underlying the observed feature interactions.

Explaining Categorical Feature Interactions Using Graph Covariance and LLMs

TL;DR

This work tackles the challenge of analyzing large temporal categorical data, using the Counter-Trafficking Data Collaborative (CTDC) as a case study, by introducing a fast, scalable graph covariance approach on one-hot encoded features. The method yields a consistent dependence measure for binary variables, enabling efficient detection of evolving interactions via per-time covariances and a simple significance rule, with two complementary pair-sets (common interactions) and (spikes). Theoretical guarantees are provided: and with , and independence iff , with a p-value approximation via . The framework achieves remarkable speed () and is paired with LLMs to generate data-driven narratives for detected interactions. In the CTDC application, the pipeline identifies meaningful interactions and yields interpretable explanations from LLMs, illustrating its utility for rapid, narrative-driven exploration of large temporal categorical datasets.

Abstract

Modern datasets often consist of numerous samples with abundant features and associated timestamps. Analyzing such datasets to uncover underlying events typically requires complex statistical methods and substantial domain expertise. A notable example, and the primary data focus of this paper, is the global synthetic dataset from the Counter Trafficking Data Collaborative (CTDC) -- a global hub of human trafficking data containing over 200,000 anonymized records spanning from 2002 to 2022, with numerous categorical features for each record. In this paper, we propose a fast and scalable method for analyzing and extracting significant categorical feature interactions, and querying large language models (LLMs) to generate data-driven insights that explain these interactions. Our approach begins with a binarization step for categorical features using one-hot encoding, followed by the computation of graph covariance at each time. This graph covariance quantifies temporal changes in dependence structures within categorical data and is established as a consistent dependence measure under the Bernoulli distribution. We use this measure to identify significant feature pairs, such as those with the most frequent trends over time or those exhibiting sudden spikes in dependence at specific moments. These extracted feature pairs, along with their timestamps, are subsequently passed to an LLM tasked with generating potential explanations of the underlying events driving these dependence changes. The effectiveness of our method is demonstrated through extensive simulations, and its application to the CTDC dataset reveals meaningful feature pairs and potential data stories underlying the observed feature interactions.
Paper Structure (15 sections, 2 theorems, 16 equations, 4 figures, 2 tables)

This paper contains 15 sections, 2 theorems, 16 equations, 4 figures, 2 tables.

Key Result

Theorem 1

At any given timestamp $t$:

Figures (4)

  • Figure 1: This figure shows the graph covariance between the baseline feature and the other simulated binary features across all timestamps.
  • Figure 2: This figure visualizes the graph covariance matrix for the years 2003, 2009, 2015, and 2021 from the CTDC data.
  • Figure 3: This figure visualizes the graph covariance and its changes over time for several noteworthy pairs of features.
  • Figure E1: Same experiments as Figure \ref{['fig1']} but using distance correlation (top two panels) and Hilbert-Schmidt independence criterion (bottom two panels).

Theorems & Definitions (3)

  • Theorem 1
  • Theorem 1
  • proof