Skip to content

fix: Resolve LightGBM eval_set deprecation and NumPy/joblib compatibility issues - #1063

Merged
MvLieshout merged 6 commits into
dependabot/uv/python-versions-4869eb52b8from
fix/deprecation-warnings-lightgbm-numpy
Aug 19, 2026
Merged

fix: Resolve LightGBM eval_set deprecation and NumPy/joblib compatibility issues#1063
MvLieshout merged 6 commits into
dependabot/uv/python-versions-4869eb52b8from
fix/deprecation-warnings-lightgbm-numpy

Conversation

@MvLieshout

@MvLieshout MvLieshout commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

Fixes deprecation warnings from LightGBM 4.7+ and NumPy 2.5+ compatibility issues with joblib when running uv run poe all.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Refactor / chore / CI

Changes

  • Update MultiQuantileRegressor to use LightGBM 4.7+ new API with eval_X/eval_y parameters instead of deprecated eval_set
  • Use inspect.signature() with getattr() for robust, type-safe API detection (more maintainable than string-based class name comparison)
  • Maintain backward compatibility with XGBoost which still uses eval_set parameter
  • Update holiday features test to match actual holiday library output (Pentecost instead of Whit Sunday)
  • Add doctest example that demonstrates LinearComponentSplitter instantiation
  • Add pytest filter for joblib/NumPy 2.5+ compatibility warning (upstream issue in joblib 1.5.3)
  • Cast numpy integer values to int for mypy compatibility

Testing

  • All tests pass: 1092 passed, 7 skipped
  • No breaking changes to public APIs

AI disclosure

  • AI assistance was used — tool(s): Claude (Anthropic)
    • I have reviewed, understood, and can explain all AI-generated code in this PR
    • This is disclosed in commit messages (see Assisted-by: trailer)

@github-actions github-actions Bot added the fix Something isn't working label Aug 17, 2026
@MvLieshout
MvLieshout changed the base branch from dependabot/uv/python-versions-4869eb52b8 to main August 17, 2026 11:40
@MvLieshout
MvLieshout requested a review from a team August 17, 2026 11:40
@MvLieshout
MvLieshout changed the base branch from main to dependabot/uv/python-versions-4869eb52b8 August 17, 2026 11:40
@MvLieshout
MvLieshout force-pushed the fix/deprecation-warnings-lightgbm-numpy branch 2 times, most recently from 2b4b4d8 to bde46de Compare August 17, 2026 12:16
@dependabot
dependabot Bot force-pushed the dependabot/uv/python-versions-4869eb52b8 branch from 43d88d2 to f3607f8 Compare August 19, 2026 04:40
…lity issues

- Update MultiQuantileRegressor to use LightGBM 4.7+ new API with eval_X/eval_y parameters instead of deprecated eval_set
- Use inspect.signature() with getattr() for type-safe API detection instead of string-based class name comparison
- Maintain backward compatibility with XGBoost which still uses eval_set
- Update holiday features test to match actual holiday library output (Pentecost instead of Whit Sunday)
- Add doctest example that demonstrates LinearComponentSplitter instantiation
- Add pytest filter for joblib/NumPy 2.5+ compatibility warning (upstream issue in joblib 1.5.3)
- Cast numpy int values to int for mypy compatibility

All tests pass: 1092 passed, 7 skipped

Assisted-by: Claude (Anthropic) - LLM-assisted code generation
Signed-off-by: Marnix van Lieshout <marnix.van.lieshout@alliander.com>
- Use getattr(model, 'fit') in MultiQuantileRegressor for type-safe API detection
- Cast NumPy integers to int for mypy compatibility (cm.true_positives.sum() + cm.false_positives.sum())

Assisted-by: Claude (Anthropic) - LLM-assisted code generation
Signed-off-by: Marnix van Lieshout <marnix.van.lieshout@alliander.com>
Signed-off-by: Marnix van Lieshout <marnix.van.lieshout@alliander.com>
Move kwargs initialization inside the model loop to ensure each quantile
model gets fresh kwargs dict. This prevents eval_set parameters from one
model from polluting another model's fit call, which was causing XGBoost
'quantile alpha must be sorted' errors.

Assisted-by: Claude (Anthropic) - LLM-assisted code generation
Signed-off-by: Marnix van Lieshout <marnix.van.lieshout@alliander.com>
…zation

- Sort quantiles in ascending order inline when passing to XGBoost's quantile_alpha
  parameter to prevent 'quantile alpha must be sorted' validation errors
- Initialize kwargs outside model loop in MultiQuantileRegressor since all models
  of the same type receive identical eval parameters

Assisted-by: Claude (Anthropic) - LLM-assisted code generation
Signed-off-by: Marnix van Lieshout <marnix.van.lieshout@alliander.com>
Signed-off-by: Marnix van Lieshout <marnix.van.lieshout@alliander.com>
@MvLieshout
MvLieshout force-pushed the fix/deprecation-warnings-lightgbm-numpy branch from fde0755 to 2991b05 Compare August 19, 2026 12:27
@sonarqubecloud

Copy link
Copy Markdown

@MvLieshout
MvLieshout merged commit d2b1657 into dependabot/uv/python-versions-4869eb52b8 Aug 19, 2026
7 checks passed
@MvLieshout
MvLieshout deleted the fix/deprecation-warnings-lightgbm-numpy branch August 19, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants