G/H evaluation - interpolation in e and z#57
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds energy-bin interpolation support to the gamma/hadron classification application pipeline and strengthens the cut-optimization utilities by validating/interpolating rate/efficiency surfaces over energy and zenith (via 1/cos(ze) or cos(ze)).
Changes:
- Add
energy_interpolation_bins()to compute(e_bin_lo, e_bin_hi, e_alpha)per event for linear interpolation between neighboring energy-bin models. - Update classification model application to interpolate probabilities and efficiency-threshold cuts between adjacent energy-bin models.
- Add unit tests covering rate-grid interpolation helpers, efficiency-surface interpolation, spectral reweighting, and classification apply interpolation; add
astropyto package dependencies.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
tests/test_optimize_classification.py |
Adds unit tests for optimize-classification interpolation helpers and spectral reweighting. |
tests/test_classification_apply_interpolation.py |
Adds tests for energy interpolation bin selection and interpolated classification apply behavior. |
src/eventdisplay_ml/scripts/optimize_classification.py |
Updates Crab spectral index constant used for reweighting; provides helpers exercised by new tests. |
src/eventdisplay_ml/models.py |
Applies classification models using (e_bin_lo, e_bin_hi, e_alpha) and interpolates probabilities/thresholds across bins. |
src/eventdisplay_ml/data_processing.py |
Introduces energy_interpolation_bins() helper to compute neighbor bins + interpolation weights. |
pyproject.toml |
Adds astropy to runtime dependencies (used by optimize/plot scripts). |
.gitignore |
Ignores .vscode/ and tmp_testing* artifacts. |
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.