From 2b77d8596b66d91d3564c6335c5471f636b38ee8 Mon Sep 17 00:00:00 2001 From: Mariam Zakaria <123750992+mariam851@users.noreply.github.com> Date: Sat, 10 Jan 2026 05:30:15 +0200 Subject: [PATCH 1/2] Fix #982: update CI and environment dependencies with proper formatting --- .github/workflows/python-package-conda.yml | 3 ++- .github/workflows/python-package-pip.yml | 2 ++ environment.yml | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml index 14c138bff..3b70d30df 100644 --- a/.github/workflows/python-package-conda.yml +++ b/.github/workflows/python-package-conda.yml @@ -29,7 +29,8 @@ jobs: - name: Install test dependencies (conda) shell: bash -l {0} run: | - conda install -y pytest coverage + # Pinning numpy and scikit-learn to prevent the issues reported in #982 + conda install -y pytest coverage "numpy>=1.22,<2.4" "scikit-learn>=1.0" "numba>=0.59.0" - name: Install package and run tests shell: bash -l {0} diff --git a/.github/workflows/python-package-pip.yml b/.github/workflows/python-package-pip.yml index 4790b1ecd..f17b4d814 100644 --- a/.github/workflows/python-package-pip.yml +++ b/.github/workflows/python-package-pip.yml @@ -24,6 +24,8 @@ jobs: - name: Install dependencies (pip) run: | python -m pip install --upgrade pip + # Fixing #982 by pinning numpy to a version compatible with numba + pip install "numpy>=1.22,<2.4" pip install pytest coverage pip install -e . diff --git a/environment.yml b/environment.yml index b1c12c982..96f2cbebc 100644 --- a/environment.yml +++ b/environment.yml @@ -3,7 +3,7 @@ channels: - conda-forge dependencies: - flake8>=4.0.1 - - numpy>=2.3.5 + - numpy>=1.21.0,<2.4.0 - pandas>=2.3.3 - scipy>=1.16.3 - scikit-learn>=1.8.0 @@ -13,4 +13,4 @@ dependencies: - pytest>=6.2.5 - setuptools>=59.4.0 - pip: - - markdown>=3.3.6 \ No newline at end of file + - markdown>=3.3.6 From 8e764e2a582b0d8cac72ac370ea9351bb71238e1 Mon Sep 17 00:00:00 2001 From: Mariam Zakaria <123750992+mariam851@users.noreply.github.com> Date: Wed, 14 Jan 2026 11:21:36 +0200 Subject: [PATCH 2/2] Fix #759: Support Keras Functional API in bias_variance_decomp --- mlxtend/evaluate/bias_variance_decomp.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mlxtend/evaluate/bias_variance_decomp.py b/mlxtend/evaluate/bias_variance_decomp.py index e1a173508..894951193 100644 --- a/mlxtend/evaluate/bias_variance_decomp.py +++ b/mlxtend/evaluate/bias_variance_decomp.py @@ -25,7 +25,7 @@ def bias_variance_decomp( loss="0-1_loss", num_rounds=200, random_seed=None, - **fit_params + **fit_params, ): """ estimator : object @@ -106,8 +106,7 @@ def bias_variance_decomp( X_boot, y_boot = _draw_bootstrap_sample(rng, X_train, y_train) # Keras support - if estimator.__class__.__name__ in ["Sequential", "Functional"]: - # reset model + if estimator.__class__.__name__ in ["Sequential", "Functional", "Model"]: for ix, layer in enumerate(estimator.layers): if hasattr(estimator.layers[ix], "kernel_initializer") and hasattr( estimator.layers[ix], "bias_initializer" @@ -128,6 +127,7 @@ def bias_variance_decomp( pred = estimator.predict(X_test).reshape(1, -1) else: pred = estimator.fit(X_boot, y_boot, **fit_params).predict(X_test) + all_pred[i] = pred if loss == "0-1_loss":