Handle deterministic predictions in Expected Improvement - #622
AHMETHAKANBEZIR1 wants to merge 1 commit into
Conversation
Use the deterministic positive-part expectation without dividing by zero. Validate against numerical Gaussian integration and a deterministic GP. Co-authored-by: Codex <codex@openai.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughExpectedImprovement.base_acq now avoids division by zero when predictive standard deviation is zero. It returns the nonnegative improvement for deterministic predictions and retains the expected-improvement formula for nonzero standard deviation. New tests cover zero-variance inputs and a deterministic Gaussian process. ChangesExpected improvement
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~8 minutes Change: Bug fix · Severity of issue fixed: Low Merge Risk: ⚪ Minimal · up to Expected Improvement now returns deterministic positive-part improvement at zero predictive variance while retaining its existing calculation for positive variance. No actionable merge risk is evident in the reviewed change. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #622 +/- ##
=======================================
Coverage 98.36% 98.36%
=======================================
Files 10 10
Lines 1220 1221 +1
=======================================
+ Hits 1200 1201 +1
Misses 20 20 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Fixes #621
When predictive std is zero, expected improvement is the positive part of the deterministic improvement, max(mean-y_max-xi,0). Avoid dividing by zero and use this result on zero-variance entries. Positive-variance entries retain the same formula and floating operation order. ProbabilityOfImprovement and its tie convention are outside this change.
Add focused tests for mixed zero/positive variance, xi=0/nonzero, scalar calls, and a real sklearn GaussianProcessRegressor with a fixed constant kernel and alpha=0. The positive-variance control uses numerical integration with scipy.stats.norm.expect instead of restating the closed-form implementation.
Validation (Windows CPU / Python 3.12):
Source installed editable with the development extra. Documentation builds, gallery notebook execution, GPU and other Python versions were not run. The current notebook-test path collects no example notebooks; the full collected test result should not be read as gallery validation.
AI assistance: Codex autonomously implemented the fix and ran validation; no independent human review has occurred. Codex is recorded as a commit coauthor.
Summary by CodeRabbit