Skip to content

Commit

Permalink
Merge pull request #200 from MarkDana/chisq_fix_overflow
Browse files Browse the repository at this point in the history
fixed the np.prod overflow issue in Chisq test
  • Loading branch information
kunwuz authored Oct 21, 2024
2 parents 7924253 + e25df9c commit d450dd8
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 d450dd8

Please sign in to comment.