Repository navigation
Fix scale-dependent SPOT prototype selection - #703
Open
student-shivamm wants to merge 1 commit into
Open
student-shivamm wants to merge 1 commit into
student-shivamm wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #703 +/- ##
==========================================
- Coverage 67.82% 67.03% -0.79%
==========================================
Files 77 77
Lines 11893 11893
==========================================
- Hits 8066 7973 -93
- Misses 3827 3920 +93 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Problem
SPOT_GreedySubsetSelectioninitializes its current minimum costs to 1,000,000. For valid costs above that bound, the initial gains are clipped to zero. This can select a worse prototype and produce incorrect weights, although multiplying all costs by a common positive scale should preserve the objective ordering.Upstream selects row 0, with a weighted cost of 3,500,000. Row 1 costs 2,500,000 and is selected for the unscaled matrix. With this patch, row 1 is selected at both scales.
Change
Use the maximum input cost as the initial upper bound. Keep objective bookkeeping in float64 to avoid integer overflow for large finite costs once the fixed cap is removed. The public signature, output shapes/types and lazy SciPy loading remain unchanged. No native/generated code or dependencies change.
Validation
4a492be, versus 16 passes with the patch. Covers selected indices, weights, input preservation and scales of 1, 1e6, 1e9 and 2**64, with an independent direct-objective reference.git diff --checkpass.AI assistance: OpenAI Codex investigated, implemented and ran the recorded local checks. No independent human code review or production incident is claimed. Any required DCO declaration remains the contributor's action; no legal signing was performed by the assistant.