Skip to content

Save regression random state - #83

Merged
GernotMaier merged 4 commits into
mainfrom
regression-random-state
Aug 28, 2026
Merged

Save regression random state#83
GernotMaier merged 4 commits into
mainfrom
regression-random-state

Conversation

@GernotMaier

Copy link
Copy Markdown
Member

No description provided.

@GernotMaier GernotMaier self-assigned this Aug 28, 2026
@GernotMaier
GernotMaier requested a balanced review from Copilot August 28, 2026 09:36
@GernotMaier
GernotMaier marked this pull request as ready for review August 28, 2026 09:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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>
@GernotMaier
GernotMaier merged commit 35a6139 into main Aug 28, 2026
2 checks passed
@GernotMaier
GernotMaier deleted the regression-random-state branch August 28, 2026 10:06
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