From 8a8f3946b6f830244fb19ef3e501855c0f1b4531 Mon Sep 17 00:00:00 2001 From: Shay Palachy Date: Thu, 11 Jun 2026 22:11:56 +0300 Subject: [PATCH] fix(ci): pin scikit-learn<1.9 to restore G13.1 notebook gate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit scikit-learn 1.9.0 changed HistGradientBoostingClassifier defaults in a way that improves the flat GBM more than the engineered one in NB02 (02_relational_feature_engineering.ipynb), causing the headline GBM(eng)−GBM(flat) AUC lift to go from +0.0110 to -0.0253 and breaking the `assert observed["headline_lift_auc"] > 0.0` guard. Observed (sklearn 1.9.0, seed 42, intermediate bundle): gbm_flat_auc: 0.6339 (target 0.6023, |diff| 0.0316 > tol 0.0200) headline_lift_auc: -0.0253 (target 0.0110, |diff| 0.0363 > tol 0.0150) Pin `scikit-learn>=1.3,<1.9` in [dev], [scripts], and [notebooks] extras to restore CI while the root cause is investigated. Tracking issue: #114. The pin should be removed once NB02 targets are recalibrated or the engineered features are revised to provide positive lift on sklearn 1.9. Co-Authored-By: Claude Sonnet 4.6 --- pyproject.toml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 871cd2a..8e55d30 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,13 @@ dev = [ "mypy>=1.10", "pre-commit>=3.7", "types-pyyaml>=6.0", - "scikit-learn>=1.3", + # scikit-learn 1.9.0 changed HistGradientBoostingClassifier defaults in a + # way that improves the flat GBM more than the engineered one, making the + # headline GBM(eng)−GBM(flat) lift in NB02 go non-positive and breaking + # the G13.1 CI gate. Pin <1.9 while the notebook targets are recalibrated + # or the engineered features are updated to restore positive lift on 1.9. + # See: https://github.com/leadforge-dev/leadforge/issues/114 + "scikit-learn>=1.3,<1.9", "matplotlib>=3.7", # PR 7.2: the preview-page renderers (scripts/preview_{kaggle,hf}_page.py) # call into markdown-it-py at test time via render_*_html(). Keeping @@ -49,7 +55,7 @@ dev = [ "markdown-it-py>=3.0", ] scripts = [ - "scikit-learn>=1.3", + "scikit-learn>=1.3,<1.9", # keep in sync with [dev] pin above "matplotlib>=3.7", ] # Optional dependencies for the platform release packagers. Installing @@ -81,7 +87,7 @@ notebooks = [ # python3`` because the GitHub-hosted runner has no kernelspecs # registered out of the box (local dev environments usually do). "ipykernel>=6.0", - "scikit-learn>=1.3", + "scikit-learn>=1.3,<1.9", # keep in sync with [dev] pin above "matplotlib>=3.7", ]