Skip to content

Preserve string and integer class labels in ClassHistogram - #697

Open
AryanRG wants to merge 1 commit into
interpretml:mainfrom
AryanRG:fix-class-histogram-labels
Open

AryanRG wants to merge 1 commit into
interpretml:mainfrom
AryanRG:fix-class-histogram-labels

Conversation

@AryanRG

@AryanRG AryanRG commented Oct 22, 2026

Copy link
Copy Markdown

ClassHistogram tries to cast all targets to float before computing class counts. This merges numeric-looking string labels such as "01" and "1", and loses precision for large integer labels.

Preserve string class names and integer values while retaining numeric float grouping, including signed zero and numeric ordering. Added regression tests for these cases and unsigned labels.

Targeted histogram and adjacent tests, formatting and mypy pass. Existing Ruff diagnostics are unchanged.

@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.60%. Comparing base (d82ea62) to head (90e8cda).

Files with missing lines Patch % Lines
python/interpret-core/interpret/data/_response.py 71.42% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #697      +/-   ##
==========================================
+ Coverage   67.32%   67.60%   +0.28%     
==========================================
  Files          77       77              
  Lines       11739    11743       +4     
==========================================
+ Hits         7903     7939      +36     
+ Misses       3836     3804      -32     
Flag Coverage Δ
bdist_linux_311_python 67.37% <71.42%> (+0.31%) ⬆️
bdist_linux_312_python ?
bdist_linux_313_python ?
bdist_linux_314_python 67.25% <71.42%> (+0.28%) ⬆️
bdist_linuxarm_311_python 67.37% <71.42%> (+0.30%) ⬆️
bdist_linuxarm_312_python ?
bdist_linuxarm_313_python ?
bdist_linuxarm_314_python 67.30% <71.42%> (+0.31%) ⬆️
bdist_mac_311_python 67.52% <71.42%> (+0.30%) ⬆️
bdist_mac_312_python ?
bdist_mac_313_python ?
bdist_mac_314_python 67.42% <71.42%> (+0.30%) ⬆️
bdist_win_311_python 67.53% <71.42%> (+0.28%) ⬆️
bdist_win_312_python ?
bdist_win_313_python ?
bdist_win_314_python 67.44% <71.42%> (+0.30%) ⬆️
sdist_linux_311_python ?
sdist_linux_312_python ?
sdist_linux_313_python ?
sdist_linux_314_python ?
sdist_linuxarm_311_python ?
sdist_linuxarm_312_python ?
sdist_linuxarm_313_python ?
sdist_linuxarm_314_python ?
sdist_mac_311_python ?
sdist_mac_312_python ?
sdist_mac_313_python ?
sdist_mac_314_python ?
sdist_win_311_python ?
sdist_win_312_python ?
sdist_win_313_python ?
sdist_win_314_python ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: AryanRG <aryanrganjoo@gmail.com>
@AryanRG
AryanRG force-pushed the fix-class-histogram-labels branch from 8779f3c to 90e8cda Compare October 23, 2026 05:33

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

Development

Successfully merging this pull request may close these issues.

1 participant