Bayesian Search - #509
Open
andrewdalpino wants to merge 7 commits into
Open
Bayesian Search#509andrewdalpino wants to merge 7 commits into
andrewdalpino wants to merge 7 commits into
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
There are correctness/performance issues in candidate generation and search-space sizing that can lead to wasted trials and severe memory usage on large spaces.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 3
Open (5)
Validate hyper-parameter values are serializable during construction · New Avoid materializing the full Cartesian product to compute search space size · New Avoid returning an already evaluated candidate after resampling fails · New Correct base() documentation to show the non-null Estimator return type · New Import Euclidean and Manhattan in the Bayesian Search example · New
What changed in this PR
Introduces a new BayesianSearch meta-estimator (TPE-style sampler) as a companion to GridSearch, including PHPUnit coverage and documentation updates to expose the new tuning option in the docs navigation.
Changes:
- Added
Rubix\ML\BayesianSearchimplementing sequential Bayesian hyper-parameter optimization with a startup random-search phase and result reporting (scores(),results(),best()). - Added end-to-end PHPUnit tests validating training, best-trial selection, result ordering, and argument validation behavior.
- Added documentation pages/links describing Bayesian Search and comparing it to Grid Search.
| File | Description |
|---|---|
| src/BayesianSearch.php | New Bayesian hyper-parameter search meta-estimator using TPE-style sampling. |
| tests/Base/BayesianSearchTest.php | New PHPUnit coverage for BayesianSearch behavior and validation. |
| docs/bayesian-search.md | New documentation page for Bayesian Search usage and API. |
| docs/hyper-parameter-tuning.md | Added Bayesian Search section and example. |
| mkdocs.yml | Added Bayesian Search to docs navigation under Meta Estimators. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Update return type of base() method and clarify hyper-parameter retrieval. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This branch has not been deployed
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.


A companion to Grid Search. Uses Optuna-style TPE to iteratively propose the next set of hyper-parameters over n trials.