Skip to content

[ENH]: Add XGBoost and XGBoost with CV Early Stopping#306

Merged
fraimondo merged 24 commits into
mainfrom
xgb_earlystopping
Jun 2, 2026
Merged

[ENH]: Add XGBoost and XGBoost with CV Early Stopping#306
fraimondo merged 24 commits into
mainfrom
xgb_earlystopping

Conversation

@fraimondo
Copy link
Copy Markdown
Contributor

This PR adds XGBoost as well as a custom XGBoost which uses CV and early stopping to determine the amount of trees to use.

Copilot AI review requested due to automatic review settings May 22, 2026 06:49
@fraimondo fraimondo changed the base branch from enh/add_heuristics to main May 22, 2026 06:49
@codecov
Copy link
Copy Markdown

codecov Bot commented May 22, 2026

Codecov Report

❌ Patch coverage is 94.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.17%. Comparing base (5501ac2) to head (5639bcc).

Files with missing lines Patch % Lines
julearn/models/available_models.py 42.85% 3 Missing and 1 partial ⚠️
julearn/models/xgb_cvearlystopping.py 97.84% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #306      +/-   ##
==========================================
+ Coverage   89.00%   89.17%   +0.16%     
==========================================
  Files          58       59       +1     
  Lines        2847     2947     +100     
  Branches      507      521      +14     
==========================================
+ Hits         2534     2628      +94     
- Misses        210      214       +4     
- Partials      103      105       +2     
Flag Coverage Δ
docs 100.00% <ø> (ø)
julearn 89.17% <94.00%> (+0.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
docs/conf.py 100.00% <ø> (ø)
julearn/models/xgb_cvearlystopping.py 97.84% <97.84%> (ø)
julearn/models/available_models.py 91.48% <42.85%> (-8.52%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces XGBoost-based models to julearn, including a custom wrapper that uses a holdout split (optionally group-aware) to determine n_estimators via early stopping, and registers these models for pipeline use. It also broadens scope with logging optimizations (delayed formatting + reduced feature logging), joblib-htcondor backend context propagation, documentation updates, and CI/workflow action version bumps.

Changes:

  • Add xgboost dependency and register xgb / xgb_cvearlystopping models (plus new tests).
  • Add DelayedFmtMessage and refactor many logs to be lazily formatted; add max_x_logs to limit verbose feature logging.
  • Add joblib-htcondor backend context propagation for config/logging/sklearn settings; update docs and GitHub Actions.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
uv.lock Locks new dependency graph including xgboost (and platform-specific wheels).
pyproject.toml Adds xgboost to core dependencies.
julearn/utils/logging.py Introduces DelayedFmtMessage for delayed log formatting.
julearn/transformers/target/ju_generated_target_model.py Switches debug logs to delayed formatting.
julearn/transformers/target/available_target_transformers.py Switches info log to delayed formatting.
julearn/transformers/dataframe/set_column_types.py Switches debug logs to delayed formatting.
julearn/transformers/dataframe/pick_columns.py Switches debug log to delayed formatting.
julearn/transformers/dataframe/drop_columns.py Switches debug log to delayed formatting.
julearn/transformers/available_transformers.py Switches info log to delayed formatting.
julearn/scoring/available_scorers.py Switches logs to delayed formatting; refactors scoring debug message.
julearn/prepare.py Limits feature logging via new max_x_logs; switches logs to delayed formatting.
julearn/pipeline/pipeline_creator.py Switches many info/debug logs to delayed formatting.
julearn/models/xgb_cvearlystopping.py Adds XGBoost CV/early-stopping wrapper estimators.
julearn/models/tests/test_xgb_cvearlystopping.py Adds tests for grouped/non-grouped fitting behavior.
julearn/models/available_models.py Registers xgb and xgb_cvearlystopping models.
julearn/model_selection/available_searchers.py Refactors logging to delayed formatting.
julearn/model_selection/_skopt_searcher.py Refactors logging to delayed formatting.
julearn/model_selection/_optuna_searcher.py Refactors logging to delayed formatting.
julearn/config.py Adds max_x_logs; adds joblib-htcondor context function helper; delayed formatting in config logging.
julearn/api.py Adds joblib backend detection/configuration hook; delayed formatting in logs.
docs/configuration.rst Documents config defaults and adds max_x_logs.
docs/changes/newsfragments/303.feature Adds release note fragment for joblib-htcondor context propagation.
docs/changes/newsfragments/301.misc Adds release note fragment for delayed log formatting.
docs/available_pipeline_steps.rst Documents the new xgb pipeline step.
.github/workflows/publish.yml Bumps softprops/action-gh-release major version.
.github/workflows/ci.yml Bumps codecov/codecov-action major version.
.github/workflows/ci-docs.yml Bumps codecov/codecov-action major version for docs CI.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread julearn/models/xgb_cvearlystopping.py Outdated
Comment thread julearn/models/xgb_cvearlystopping.py Outdated
Comment thread julearn/models/tests/test_xgb_cvearlystopping.py
Comment thread julearn/models/xgb_cvearlystopping.py Outdated
Comment thread docs/available_pipeline_steps.rst
Comment thread pyproject.toml
Comment thread julearn/models/xgb_cvearlystopping.py
Comment thread pyproject.toml Outdated
@fraimondo fraimondo force-pushed the xgb_earlystopping branch from 2821029 to 0862693 Compare May 27, 2026 11:41
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 27, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-06-02 08:28 UTC

@fraimondo fraimondo force-pushed the xgb_earlystopping branch from 2200d1f to 87c0546 Compare May 30, 2026 08:26
@fraimondo fraimondo requested a review from synchon May 30, 2026 19:49
Comment thread julearn/models/xgb_cvearlystopping.py Outdated
Comment thread julearn/models/xgb_cvearlystopping.py Outdated
Comment thread julearn/models/xgb_cvearlystopping.py Outdated
Comment thread julearn/models/xgb_cvearlystopping.py Outdated
Comment thread julearn/models/xgb_cvearlystopping.py Outdated
@fraimondo fraimondo merged commit bc239b2 into main Jun 2, 2026
17 checks passed
@fraimondo fraimondo deleted the xgb_earlystopping branch June 2, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants