Skip to content

Commit d450dd8

Browse files
authored
Merge pull request #200 from MarkDana/chisq_fix_overflow
fixed the np.prod overflow issue in Chisq test
2 parents 7924253 + e25df9c commit d450dd8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

causallearn/utils/cit.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ def _Fill3DCountTableByUnique(dataSXY, cardSXY):
288288
def _Fill3DCountTable(dataSXY, cardSXY):
289289
# about the threshold 1e5, see a rough performance example at:
290290
# https://gist.github.com/MarkDana/e7d9663a26091585eb6882170108485e#file-count-unique-in-array-performance-md
291-
if np.prod(cardSXY) < CONST_BINCOUNT_UNIQUE_THRESHOLD: return _Fill3DCountTableByBincount(dataSXY, cardSXY)
291+
if 0 < np.prod(cardSXY) < CONST_BINCOUNT_UNIQUE_THRESHOLD: return _Fill3DCountTableByBincount(dataSXY, cardSXY)
292292
return _Fill3DCountTableByUnique(dataSXY, cardSXY)
293293

294294
def _CalculatePValue(cTables, eTables):

0 commit comments

Comments
 (0)