Skip to content

Preserve text class labels in classification lift tables - #1995

Open
Afloat16 wants to merge 1 commit into
evidentlyai:mainfrom
Afloat16:fix/lift-table-text-labels-20261112
Open

Afloat16 wants to merge 1 commit into
evidentlyai:mainfrom
Afloat16:fix/lift-table-text-labels-20261112

Conversation

@Afloat16

Copy link
Copy Markdown

Problem

ClassificationLiftTable converts probability column labels to int in both the binary and multiclass paths. Valid text classes such as cat/dog or Unicode labels raise ValueError before the report can be produced. PredictionData, the result schema, and the renderer already support text labels, and ClassificationPRTable already preserves them.

Change

Use the original class labels as lift-table keys. Leave target binarization, table calculations, rendering, and the existing numeric-key JSON deserialization behavior unchanged.

Validation

  • 15 new tests against the upstream base: 12 failed, 3 passed.
  • The fixed tests and the existing report JSON test: 16 passed on CPU.
  • Binary and multiclass English/Unicode labels match equivalent integer-encoded tables; independent assertions check the final TP/FP counts, precision, recall, and lift values.
  • Native legacy Report cases cover current/reference data, JSON round trips, renderer tabs, and unchanged input frames.
  • Integer-key JSON round trips remain covered.
  • Repository-pinned Ruff 0.3.7 lint/format and git diff --check pass.

This corrects text-label handling in the legacy classification lift-table metric. It does not change lift formulas or the existing normalization of numeric-looking dictionary keys. The full repository and notebook smoke suites were not run.

This branch has not been deployed

No deployments
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