Skip to content

Clear pandas.cut argument from float('inf') values #13

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions autowoe/lib/report/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,10 +523,9 @@ def __get_binned_data(self, bin_count):

for df in [train_binned, test_binned]:
df['Score'] = np.log(df['P'] / (1 - df['P']))
if bins is not None:
df['ScoreBin'] = pd.cut(df['Score'], bins, retbins=False)
else:
df['ScoreBin'], bins = pd.cut(df['Score'], bin_count, retbins=True)
if bins is None:
_intervals, bins = pd.cut(df['Score'][~np.isinf(df['Score'])], bin_count, retbins=True)
df['ScoreBin'] = pd.cut(df['Score'], bins, retbins=False)

return train_binned, test_binned

Expand Down