Skip to content

Commit

Permalink
Merge pull request #6 from mmeendez8/patch-1
Browse files Browse the repository at this point in the history
Comparison between floats is resulting in bug
  • Loading branch information
abhayspawar authored Nov 14, 2018
2 parents ee7ab67 + 6e5623c commit 2802026
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions featexp/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def get_grouped_data(input_data, feature, target_col, bins, cuts=0):
reduced_cuts = 0
for i in range(1, bins + 1):
next_cut = np.percentile(input_data[feature], i * 100 / bins)
if next_cut != prev_cut:
if next_cut > prev_cut + .000001: # float numbers shold be compared with some threshold!
cuts.append(next_cut)
else:
reduced_cuts = reduced_cuts + 1
Expand Down Expand Up @@ -265,4 +265,4 @@ def get_trend_stats(data, target_col, features_list=0, bins=10, data_test=0):
print('Categorical features ' + str(ignored) + ' ignored. Categorical features not supported yet.')

print('Returning stats for all numeric features')
return (stats_all_df)
return (stats_all_df)

0 comments on commit 2802026

Please sign in to comment.