Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
LODA builds each histogram correctly, but searches its first
n_bins - 1edges when scoring projected values. That includes the outer left edge and omits the last interior edge, assigning most values inside bins to the wrong density.For a simple example:
The histogram counts are
[3, 1, 2], so the expected scores are[0.693, 0.693, 0.693, 1.792, 1.099, 1.099]. Currently they are[0.693, 1.792, 1.792, 1.099, 1.099, 1.099].Search the interior edges with
side='right'in bothfitanddecision_function, for fixed and automatic bin counts. This matches NumPy's left-closed bins while retaining the existing treatment of exact boundaries and values outside the histogram support. Projection generation, histogram counts, smoothing and score weighting are unchanged.The regression covers bin interiors, boundaries, outside-support values and independent scalar histogram counts across multiple projections, including one-bin controls. The interior and multi-bin cases fail before the fix. All 32 LODA tests pass after it, with 97% statement coverage of
pyod/models/loda.pyand all four changed lookups covered.In a separate 36-configuration run on sklearn's Digits, Wine and Iris datasets, scores now match direct interval-count references exactly. Before the fix, 8,104 training scores and 7,143 query scores differed; both counts are now zero. All projections and histograms are identical before/after, and one-bin controls retain identical scores. These checks establish correct histogram scoring, not improved detection quality.
Submission checks
development.