Skip to content

fix(nominal): support non-zero-based category labels in functional metrics (#3460) - #3461

Open
Sayyam-Akram wants to merge 2 commits into
Lightning-AI:masterfrom
Sayyam-Akram:fix-nominal-metrics-nonzero-labels
Open

fix(nominal): support non-zero-based category labels in functional metrics (#3460)#3461
Sayyam-Akram wants to merge 2 commits into
Lightning-AI:masterfrom
Sayyam-Akram:fix-nominal-metrics-nonzero-labels

Conversation

@Sayyam-Akram

Copy link
Copy Markdown

What does this PR do?

Fixes #3460

  • Remaps unique categorical labels in functional nominal metrics (cramers_v, pearsons_contingency_coefficient, theils_u, tschuprows_t, and their _matrix versions) to contiguous 0-based indices before updating the confusion matrix.
  • Casts confmat to float in _compute_chi_squared before applying Yates' continuity correction to prevent Long-to-Float in-place addition RuntimeError.
  • Adds unit tests verifying behavior on non-zero-based category labels across all nominal metrics.
Before submitting
  • Was this discussed/agreed via a Github issue?
  • Did you read the contributor guideline?
  • Did you write any new necessary tests?

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.

Functional nominal metrics raise RuntimeError when category labels do not start at 0

1 participant