Fix E9: move default XGBoost hyperparameters into bundled JSON files#67
Merged
Conversation
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>
66 tasks
Contributor
There was a problem hiding this comment.
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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