From 8e843071d6aafb736c4d81195112b282591b9bd2 Mon Sep 17 00:00:00 2001 From: Patrick Bloebaum Date: Mon, 28 Oct 2024 10:38:15 -0700 Subject: [PATCH] Fix issue in KL divergence estimator with non-unique values Signed-off-by: Patrick Bloebaum --- dowhy/gcm/divergence.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dowhy/gcm/divergence.py b/dowhy/gcm/divergence.py index 88ddf4e749..59b141c153 100644 --- a/dowhy/gcm/divergence.py +++ b/dowhy/gcm/divergence.py @@ -61,7 +61,7 @@ def estimate_kl_divergence_continuous_knn( # Making sure that X and Y have no overlapping values, which would lead to a distance of 0 with k=1 and, thus, to # a division by zero. if remove_common_elements: - X = setdiff2d(X, Y, assume_unique=True) + X = setdiff2d(X, Y, assume_unique=False) if X.shape[0] < k + 1: # All elements are equal (or at least less than k samples are different) return 0