Save regression random state - #83
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds reproducible stereo-regression training and persists an auditable training record.
Changes:
- Defaults regression randomness to seed 42 across sampling, splitting, diagnostics, and XGBoost.
- Persists and reloads training parameters, input manifests, and model metadata.
- Adds documentation and regression-contract tests.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
README.md |
Documents reproducibility and persisted metadata. |
docs/changes/83.feature.md |
Adds the feature changelog entry. |
src/eventdisplay_ml/config.py |
Sets the regression CLI seed default. |
src/eventdisplay_ml/data_processing.py |
Applies the seed during loading and records inputs. |
src/eventdisplay_ml/models.py |
Uses and persists effective training parameters. |
src/eventdisplay_ml/utils.py |
Defines the shared default seed. |
tests/test_models_helpers.py |
Tests training-record persistence. |
tests/test_regression_contracts.py |
Tests loading persisted metadata. |
tests/test_train_regression_standardization.py |
Tests recorded seeds and parameters. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+122
to
+126
| def test_training_record_contains_all_regression_seeds_and_parameters( | ||
| self, regression_training_df, regression_model_config | ||
| ): | ||
| """Persist the effective reproducibility and XGBoost training record.""" | ||
| result = models.train_regression(regression_training_df, regression_model_config) |
Contributor
There was a problem hiding this comment.
Implemented in commit a064e0c. I added coverage for both missing and None regression random_state, verifying seed defaulting to 42 reaches train/test splitting, eval/diagnostic/SHAP sampling, and the XGBoost constructor; and I added CLI/config + data-loading path assertions that the default 42 is applied and used by sampling RNG.
Co-authored-by: GernotMaier <14001688+GernotMaier@users.noreply.github.com>
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.
No description provided.