Repository navigation
Use fitted bins for automatic numerical PSI thresholds - #1118
Open
Swapnil-byte-798 wants to merge 1 commit into
Open
Swapnil-byte-798 wants to merge 1 commit into
Swapnil-byte-798 wants to merge 1 commit into
Conversation
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.
What changed
For
DropHighPSIFeatures(threshold="auto"), the chi-squared threshold used the requested number of bins even when equal-frequency discretization dropped duplicate quantile boundaries. Calculate the degrees of freedom from each feature's fitted bin edges.Reproduction
With 100 rows in each split, change a binary-valued numerical score from 50% ones in the basis to 73% ones in the test split. Requests for two and ten bins both fit the same two bins and give PSI ≈ 0.229. The current threshold is ≈ 0.217 with
bins=2and ≈ 0.558 withbins=10, so only the former flags drift. Both requests now use ≈ 0.217.The regression checks the numerical PSI, the feature selected for removal, and the transformed dataframe. The ten-bin case failed before the patch. All 177 tests in the focused PSI and discretization suites pass locally. Black and
git diff --checkpass.The numerical bin-count calculation may also be relevant to the migration in #1089.
Codex assisted with reproduction, implementation, and tests.