Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion optbinning/binning/continuous_binning.py
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,8 @@ def _prebinning_refinement(self, splits_prebinning, x, y, y_missing,
def _compute_prebins(self, splits_prebinning, x, y, sw):
n_splits = len(splits_prebinning)
if not n_splits:
return splits_prebinning, np.array([]), np.array([])
return (splits_prebinning, np.array([]), np.array([]), np.array([]),
np.array([]), np.array([]), np.array([]), np.array([]))

if self.dtype == "categorical" and self.user_splits is not None:
indices = np.digitize(x, splits_prebinning, right=True)
Expand Down
3 changes: 1 addition & 2 deletions tests/test_binning_piecewise.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,7 @@ def test_default_discontinuous():
optb.fit(x, y)

optb.binning_table.build()
assert optb.binning_table.iv == approx(5.84465825, rel=1e-6)

assert optb.binning_table.iv == approx(5.84465825, rel=1e-4)

def test_bounds_transform():
optb = OptimalPWBinning(name=variable)
Expand Down