Skip to content

Fix critical bugs and improve code quality from code review#12

Merged
jxucoder merged 1 commit intomainfrom
claude/code-review-lLca3
Mar 14, 2026
Merged

Fix critical bugs and improve code quality from code review#12
jxucoder merged 1 commit intomainfrom
claude/code-review-lLca3

Conversation

@jxucoder
Copy link
Copy Markdown
Owner

  • Fix off-by-one bin index clipping in _array.py (len(edges) -> len(edges) - 1)
  • Add epsilon guard to softmax denominator in _loss.py to prevent division by zero
  • Replace silent except Exception: pass with warnings.warn() for CUDA kernel
    compilation failures across _loss.py, _predict.py, _core/_primitives.py, _models/_gam.py
  • Add security warning to joblib deserialization docstring in _persistence.py
  • Fix ruff target-version mismatch (py311 -> py310) to match requires-python
  • Align dependency version conflicts in pyproject.toml (xgboost, pytest)
  • Add ruff lint step to CI workflow
  • Add warnings for silent n_bins truncation and unseen categories in _array.py
  • Add DeprecationWarning for NGBoost* aliases via module getattr

https://claude.ai/code/session_013WmZYijJFKvq2YM3sHZJmD

- Fix off-by-one bin index clipping in _array.py (len(edges) -> len(edges) - 1)
- Add epsilon guard to softmax denominator in _loss.py to prevent division by zero
- Replace silent `except Exception: pass` with warnings.warn() for CUDA kernel
  compilation failures across _loss.py, _predict.py, _core/_primitives.py, _models/_gam.py
- Add security warning to joblib deserialization docstring in _persistence.py
- Fix ruff target-version mismatch (py311 -> py310) to match requires-python
- Align dependency version conflicts in pyproject.toml (xgboost, pytest)
- Add ruff lint step to CI workflow
- Add warnings for silent n_bins truncation and unseen categories in _array.py
- Add DeprecationWarning for NGBoost* aliases via module __getattr__

https://claude.ai/code/session_013WmZYijJFKvq2YM3sHZJmD
@jxucoder jxucoder merged commit ffe9d46 into main Mar 14, 2026
0 of 6 checks passed
@jxucoder jxucoder deleted the claude/code-review-lLca3 branch March 14, 2026 05:22
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6163f6f32c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

bin_idx = np.searchsorted(edges, col[~nan_mask], side='right')
# Clip to valid range (in case test values exceed training range)
bin_idx = np.clip(bin_idx, 0, len(edges))
bin_idx = np.clip(bin_idx, 0, len(edges) - 1)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep highest numeric bin reachable in transform

np.digitize in training produces bin indices in [0, len(edges)], where values above the largest edge map to len(edges). Clipping transform-time indices to len(edges) - 1 remaps all out-of-range high values into the second-highest bin, so inference no longer matches training bin semantics and can change split routing/predictions whenever test data exceeds the training range.

Useful? React with 👍 / 👎.

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.

2 participants