Skip to content

Learning improvements / testing.#53

Merged
GernotMaier merged 28 commits intomainfrom
residuals-overlearning
Apr 3, 2026
Merged

Learning improvements / testing.#53
GernotMaier merged 28 commits intomainfrom
residuals-overlearning

Conversation

@GernotMaier
Copy link
Copy Markdown
Member

No description provided.

@GernotMaier GernotMaier self-assigned this Feb 20, 2026
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 pull request implements residual learning for stereo reconstruction models and adds training evaluation capabilities. The core change shifts from predicting absolute direction/energy values to predicting residuals relative to DispBDT baseline predictions. This approach allows the XGBoost model to learn corrections to an existing baseline method rather than learning from scratch.

Changes:

  • Implements residual learning architecture: models now predict corrections to DispBDT predictions rather than absolute values
  • Adds target standardization during training to balance the contribution of direction (Xoff, Yoff) and energy features in multi-target learning
  • Adds plot_training_evaluation.py script to visualize training curves and assess model convergence
  • Updates hyperparameters: reduces learning rate, increases n_estimators, adds regularization, enables early stopping
  • Filters training data to remove events with invalid energy reconstruction (ErecS <= 0)

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
src/eventdisplay_ml/scripts/train_xgb_stereo.py Updated docstring to explain residual learning approach
src/eventdisplay_ml/scripts/plot_training_evaluation.py New script to plot training/validation curves from saved models
src/eventdisplay_ml/models.py Implements residual learning, target standardization, inverse transformation in inference, adds eval_set to regression training, removes eval_set from classification training
src/eventdisplay_ml/hyper_parameters.py Updates hyperparameters for better regularization and early stopping
src/eventdisplay_ml/features.py Changes targets from absolute values to residuals
src/eventdisplay_ml/evaluate.py Updates evaluation to work with residual predictions and reconstruct absolute values
src/eventdisplay_ml/data_processing.py Adds residual computation logic, filters invalid energy events
pyproject.toml Adds new script entry point for training evaluation plotting
docs/changes/53.feature.md Documents the new features
.github/copilot-instructions.md Updates documentation to reflect residual learning architecture

Comment thread src/eventdisplay_ml/models.py Outdated
Comment thread src/eventdisplay_ml/models.py Outdated
Comment thread src/eventdisplay_ml/models.py Outdated
Comment thread src/eventdisplay_ml/evaluate.py Outdated
Comment thread src/eventdisplay_ml/scripts/plot_training_evaluation.py
Comment thread src/eventdisplay_ml/data_processing.py
Comment thread src/eventdisplay_ml/models.py
Comment thread src/eventdisplay_ml/models.py
Comment thread src/eventdisplay_ml/models.py Outdated
Comment thread src/eventdisplay_ml/hyper_parameters.py Outdated
GernotMaier and others added 2 commits February 20, 2026 14:40
Co-authored-by: Copilot <175728472+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

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Comment thread src/eventdisplay_ml/models.py Outdated
Comment thread src/eventdisplay_ml/scripts/plot_training_evaluation.py
Comment thread docs/changes/53.feature.md Outdated
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

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

Comment thread tests/test_regression_apply.py Outdated
Comment thread tests/test_apply_regression_standardization.py Outdated
Comment thread src/eventdisplay_ml/scripts/diagnostic_shap_summary.py Outdated
Comment thread src/eventdisplay_ml/models.py Outdated
Comment thread src/eventdisplay_ml/models.py
Comment thread tests/test_regression_apply.py Outdated
GernotMaier and others added 2 commits March 23, 2026 20:21
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* improved changelog

* improved readme

* add diagnostic docu

* dependabot

* diagnostics

* importance

* docstring improvements

* generalization gap

* pyproject.toml

* diagnostics

* readme

* changelog

* warnings

* sign

* correction cp
@GernotMaier GernotMaier marked this pull request as ready for review April 3, 2026 15:49
@GernotMaier GernotMaier requested a review from Copilot April 3, 2026 15:50
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

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

Comment thread src/eventdisplay_ml/models.py
Comment thread tests/test_train_regression_standardization.py
Comment thread src/eventdisplay_ml/diagnostic_utils.py
Comment thread src/eventdisplay_ml/scripts/diagnostic_residual_normality.py
Comment thread src/eventdisplay_ml/scripts/diagnostic_shap_summary.py Outdated
Comment thread src/eventdisplay_ml/models.py
Comment thread src/eventdisplay_ml/models.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@GernotMaier GernotMaier merged commit 4cf2966 into main Apr 3, 2026
2 checks passed
@GernotMaier GernotMaier deleted the residuals-overlearning branch April 3, 2026 15:59
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.

2 participants