Skip to content

Commit

Permalink
fix the np.prod overflow issue in Chisq test
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkDana authored Oct 17, 2024
1 parent 7924253 commit e25df9c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion causallearn/utils/cit.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def _Fill3DCountTableByUnique(dataSXY, cardSXY):
def _Fill3DCountTable(dataSXY, cardSXY):
# about the threshold 1e5, see a rough performance example at:
# https://gist.github.com/MarkDana/e7d9663a26091585eb6882170108485e#file-count-unique-in-array-performance-md
if np.prod(cardSXY) < CONST_BINCOUNT_UNIQUE_THRESHOLD: return _Fill3DCountTableByBincount(dataSXY, cardSXY)
if 0 < np.prod(cardSXY) < CONST_BINCOUNT_UNIQUE_THRESHOLD: return _Fill3DCountTableByBincount(dataSXY, cardSXY)
return _Fill3DCountTableByUnique(dataSXY, cardSXY)

def _CalculatePValue(cTables, eTables):
Expand Down

0 comments on commit e25df9c

Please sign in to comment.