Skip to content

Fix E9: move default XGBoost hyperparameters into bundled JSON files#67

Merged
GernotMaier merged 2 commits into
mainfrom
issue-352
May 31, 2026
Merged

Fix E9: move default XGBoost hyperparameters into bundled JSON files#67
GernotMaier merged 2 commits into
mainfrom
issue-352

Conversation

@GernotMaier
Copy link
Copy Markdown
Member

Replace hard-coded Python dicts XGB_REGRESSION_HYPERPARAMETERS and XGB_CLASSIFICATION_HYPERPARAMETERS with versioned JSON files under src/eventdisplay_ml/configs/. The hyper_parameters module now always loads from a file (bundled default or user --hyperparameter_config), making the full training configuration auditable and reproducible.

Also add missing docs/changes fragments for the unit-test suite and this fix.

Closes #66

Replace hard-coded Python dicts XGB_REGRESSION_HYPERPARAMETERS and
XGB_CLASSIFICATION_HYPERPARAMETERS with versioned JSON files under
src/eventdisplay_ml/configs/. The hyper_parameters module now always
loads from a file (bundled default or user --hyperparameter_config),
making the full training configuration auditable and reproducible.

Also add missing docs/changes fragments for the unit-test suite and
this fix.

Closes #66

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

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 moves default XGBoost hyperparameters out of Python constants and into bundled JSON files, making default model configuration easier to version and audit for Eventdisplay-ML training workflows.

Changes:

  • Replaces hard-coded regression/classification hyperparameter dicts with JSON loading via importlib.resources.
  • Adds bundled default stereo and classification hyperparameter JSON files to package data.
  • Adds Towncrier changelog fragments for this fix and related prior work.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/eventdisplay_ml/hyper_parameters.py Loads default or user-supplied hyperparameters from JSON files.
src/eventdisplay_ml/configs/default_hyperparameters_stereo.json Adds bundled stereo XGBoost defaults.
src/eventdisplay_ml/configs/default_hyperparameters_classification.json Adds bundled classification XGBoost defaults.
pyproject.toml Includes bundled JSON configs as package data.
tests/test_hyper_parameters.py Updates default hyperparameter test to expect freshly loaded dicts.
docs/changes/66.feature.md Documents this hyperparameter-config change.
docs/changes/63.maintenance.md Adds missing maintenance changelog fragment.
docs/changes/63.bugfix.md Adds missing bugfix changelog fragment.

"max_depth": 7,
"min_child_weight": 10.0,
"objective": "reg:squarederror",
"n_jobs": 8,
"subsample": 0.8,
"colsample_bytree": 0.6,
"random_state": null,
"n_jobs": 96
@GernotMaier GernotMaier marked this pull request as ready for review May 31, 2026 11:29
@GernotMaier GernotMaier merged commit 5b5376c into main May 31, 2026
3 of 4 checks passed
@GernotMaier GernotMaier deleted the issue-352 branch May 31, 2026 11:29
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.

E9: XGBoost hyperparameters are hard-coded in Python, not versioned in auxiliary parameter files

2 participants