Repository navigation
miceforest: finite log-odds for binary columns (v0.23.2) - #138
Merged
Merged
Conversation
….23.2 A binary column with a very rare level makes LightGBM predict a probability of exactly 0 or 1; miceforest's unguarded log-odds then gives an infinity and its KDTree stops the run. While the kernel fits and imputes, the log-odds are taken on probabilities clipped to [1e-12, 1 - 1e-12], which keeps their order. Documented in docs/verification.md; a unit test reproduces the case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014NVzBhXV6pjUrMK1PN7vGi
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.
Requested by Alp
A binary column with a very rare level makes LightGBM predict a probability of exactly 0 or 1; miceforest 6.0.5's unguarded log-odds then gives an infinity and its KDTree stops the run (ValueError: data must be finite). While the kernel fits and imputes, the log-odds are computed on probabilities clipped to [1e-12, 1 - 1e-12], which keeps their order. Documented in docs/verification.md. The new unit test (3 positives in 2000 rows) fails without the fix. Cloud checks: ruff clean, ty 0 errors, unit suite 809 passed.
Windows checks:
test_imputation_miceforest.pypasses 7 of 7, and the new test fails without the clip.compute.py(Windows-only, unrelated to this change).🤖 Generated with Claude Code
https://claude.ai/code/session_014NVzBhXV6pjUrMK1PN7vGi