From 92b132905d4122ca0a2b6b9a1d908e9bb1ce8c88 Mon Sep 17 00:00:00 2001 From: yc Date: Wed, 28 May 2025 15:54:09 -0400 Subject: [PATCH 1/3] return expected 8 number of items instead of 3 --- optbinning/binning/continuous_binning.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/optbinning/binning/continuous_binning.py b/optbinning/binning/continuous_binning.py index 0b6d3f3..927d2b7 100644 --- a/optbinning/binning/continuous_binning.py +++ b/optbinning/binning/continuous_binning.py @@ -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) From 0374492cca8345a374599f5fa05640fc2418aeed Mon Sep 17 00:00:00 2001 From: yc Date: Mon, 2 Jun 2025 08:42:03 -0400 Subject: [PATCH 2/3] increase test piecewise tolerance to 1e-4. See details in https://github.com/guillermo-navas-palencia/optbinning/pull/358#issuecomment-2929410655 --- tests/test_binning_piecewise.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_binning_piecewise.py b/tests/test_binning_piecewise.py index 29ea04d..1a90222 100644 --- a/tests/test_binning_piecewise.py +++ b/tests/test_binning_piecewise.py @@ -189,7 +189,7 @@ def test_default_discontinuous(): 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) From 9d34b0896c1dc696fff880699ee2375a347b9269 Mon Sep 17 00:00:00 2001 From: YC97 <54824364+YC-1412@users.noreply.github.com> Date: Tue, 3 Jun 2025 18:08:44 -0400 Subject: [PATCH 3/3] increase test piecewise tolerance to 1e-4. See details in https://github.com/guillermo-navas-palencia/optbinning/pull/358#issuecomment-2929410655 --- tests/test_binning_piecewise.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_binning_piecewise.py b/tests/test_binning_piecewise.py index 1a90222..c0138df 100644 --- a/tests/test_binning_piecewise.py +++ b/tests/test_binning_piecewise.py @@ -188,7 +188,6 @@ 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():