Skip to content

miceforest: finite log-odds for binary columns (v0.23.2) - #138

Merged
alperkent merged 1 commit into
mainfrom
claude/miceforest-logodds
Oct 28, 2026
Merged

alperkent merged 1 commit into
mainfrom
claude/miceforest-logodds

Conversation

@alperkent

Copy link
Copy Markdown
Collaborator

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:

  • Lint: ruff check and format are clean.
  • Tests: test_imputation_miceforest.py passes 7 of 7, and the new test fails without the clip.
  • ty: errors appear only in compute.py (Windows-only, unrelated to this change).

🤖 Generated with Claude Code

https://claude.ai/code/session_014NVzBhXV6pjUrMK1PN7vGi

….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
@alperkent alperkent self-assigned this Oct 28, 2026
@alperkent
alperkent merged commit 3dcd520 into main Oct 28, 2026
6 checks passed
@alperkent
alperkent deleted the claude/miceforest-logodds branch October 28, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant