fix(oddshap): address all six Copilot review comments on PR #522#5
Merged
Conversation
- Validate the budget before sampling/evaluating the game so an invalid budget fails fast without paying for game evaluations. - Restore the full-budget semantics: when the sampler enumerates all 2**n coalitions, the candidate odd support is no longer truncated to ceil(budget/eta). - InteractionValues now carries index=self.approximation_index and target_index=self.index instead of hard-coded strings. - Rewrite the stale test-module docstring (it still described the removed low-budget TreeExplainer fallback and a non-existent xfail marker). - Mark the OddSHAP test module skip_if_no_lightgbm, matching the other LightGBM-dependent suites (lightgbm is an optional extra). - Reindent the new references.bib entry with spaces (2-space style of the surrounding entries) instead of tabs.
…test - Mark the five defensive, structurally unreachable raises with 'pragma: no cover' (empty/grand coalition presence, unbuilt support, empty constraint system, coefficient-shape mismatch), following the existing convention in approximator/base.py and regression/base.py. - Add real tests for the previously uncovered reachable branches: degenerate-n weight initializers (ValueError), the tree_params branch of _fit_surrogate_model, _build_support(None), and _build_weighted_system(drop_boundary_rows=False). - Replace the vacuous full-budget screening test (it asserted nothing about truncation) with an end-to-end check that approximate() passes the untruncated candidate count at budget=2**n, plus a direct check that a large candidate budget returns the full odd support. - references.bib: align the '=' column of the new entry with the file's longest-key+1 convention (was only tab->space converted).
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.
Resolves every inline comment from the Copilot review on mmschlk#522 (2026-06-10):
budget < n*interaction_factorcheck now runs before_sampler.sample()/game(), so callers no longer pay for game evaluations before theValueError.budget >= 2**nthe candidate odd support bypasses theceil(budget/eta)top-k cap (the regression is exact there).InteractionValues(index=self.approximation_index, ..., target_index=self.index).skip_if_no_lightgbmadded as module-levelpytestmark, matching the ProxySPEX test suite (lightgbm is under the optionalproxyextra).59/59 OddSHAP unit tests pass; ruff clean.