Add GPR functions and unit tests#4
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a Gaussian Process Regression (GPR) machine learning library for predicting orbital parameters, consisting of a self-contained model class with normalization capabilities and associated training/prediction functions. The implementation includes comprehensive unit tests to validate functionality.
- GPR model implementation with mixed RBF and Matern kernels, linear mean function, and input/output normalization
- Training and prediction functions with stored normalization parameters
- Complete pipeline function for training, prediction, visualization, and metrics reporting
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 17 comments.
| File | Description |
|---|---|
| GPR_library.py | Implements GPRegressionModel class, training function with Adam optimizer and learning rate scheduling, prediction function with denormalization, and full pipeline with plotting capabilities |
| TestGPRLibrary.py | Provides comprehensive unit tests covering training, prediction, normalization/denormalization, and pipeline functionality using synthetic sine wave data |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
nilsvu
left a comment
There was a problem hiding this comment.
Very nice code and useful tests, the comments are very helpful 👍 please fix these minor comments and also address the copilot review above.
25487ec to
716fff2
Compare
There was a problem hiding this comment.
Looks good. Please fix the few unresolved comments above. In particular, please explain the magic numbers. You can add comments explaining how you chose them, and give an idea how much you have tested different numbers. The idea is to give people editing the code an idea if these are finely tuned numbers that should not be touched, or barely explored at all and open for experimentation.
Then please squash all of your commits into one.
nilsvu
left a comment
There was a problem hiding this comment.
Please squash your commit into one (including these changes). Please also rebase on the latest main branch, as the test you added wasn't run by GitHub. It will run automatically once you rebased.
c83edb7 to
60b6d9f
Compare
nilsvu
left a comment
There was a problem hiding this comment.
The automated tests run now and pass 👍 Merging this now so we can move on with the next PRs. We can clarify or fix the question below in a follow-up (probably best to make the number of training iterations an input parameter with a default).
Partial merge of the Gaussian Process Regression (GPR) Library for predicting the radial expansion rate and radial velocity of BBH simulations, currently consisting only of the self contained ML class and functions (no eccentricity control related functions).
Contains the following:
Unit tests covering training, prediction, normalization/denormalization, and pipeline functionality using synthetic sine wave data are included for sanity check.