Skip to content

Commit

Permalink
BUGFIX - Replace numpy product function to avoid overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rmazzine committed Aug 4, 2022
1 parent 855361b commit 2c0c160
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cfnow/_cf_searchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
import math
import copy
import logging
import operator
from collections import deque
from datetime import datetime
from functools import reduce
from itertools import combinations

import numpy as np
Expand Down Expand Up @@ -240,7 +242,7 @@ def _calc_num_possible_changes(change_feat_options, num_placeholders, ohe_placeh
comb_rows.append(2)
# Then, after scanning all features in a single change (icc), we calculate the number of
# derived modifications by multiplying the items inside comb_rows
corrected_num_changes += np.prod(comb_rows)
corrected_num_changes += reduce(operator.mul, comb_rows)
else:
# The sample will be 1 above the limit threshold
corrected_num_changes = threshold_changes + 1
Expand Down

0 comments on commit 2c0c160

Please sign in to comment.