Repository navigation
Add probability calibration visualization - #678
Open
ChidiebereNjoku wants to merge 2 commits into
Open
ChidiebereNjoku wants to merge 2 commits into
ChidiebereNjoku wants to merge 2 commits into
Conversation
Signed-off-by: ChidiebereNjoku <144056487+ChidiebereNjoku@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #678 +/- ##
==========================================
+ Coverage 67.32% 67.40% +0.08%
==========================================
Files 77 77
Lines 11739 11817 +78
==========================================
+ Hits 7903 7965 +62
- Misses 3836 3852 +16 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
Valid floating-point classification targets can raise a class-lookup error instead of producing a calibration explanation.
1 open issue
What changed in this PR
Adds binary-classifier probability calibration to InterpretML’s performance explainers, addressing #625 alongside the existing ROC and PR tools.
Changes:
- Computes calibration curves with uniform or quantile binning.
- Displays reliability curves and predicted-probability distributions.
- Adds public exports, tests, and API documentation.
| File | Description |
|---|---|
| python/interpret-core/tests/tutils.py | Registers calibration in shared explainer tests. |
| python/interpret-core/tests/perf/test_curve.py | Tests calculations, visualization, and validation. |
| python/interpret-core/tests/perf/__init__.py | Initializes the performance test package. |
| python/interpret-core/interpret/visual/plot.py | Adds calibration plotting. |
| python/interpret-core/interpret/perf/_curve.py | Implements the calibration explainer and explanation. |
| python/interpret-core/interpret/perf/__init__.py | Exports CalibrationCurve. |
| docs/interpret/python/api/CalibrationCurve.ipynb | Adds API documentation. |
| docs/interpret/_toc.yml | Includes the new documentation page. |
| docs/extras/sitemap.xml | Adds the calibration API URL. |
Review effort: Balanced
Comment on lines
+269
to
+270
| y = typify_classification(y) | ||
| if classes is None: |
This branch has not been deployed
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.

Description
Adds a
CalibrationCurveperformance explainer for binary classifiers, following the existingROCandPRconventions.The new explainer:
calibration_curveinterpret.perfand included in the performance API documentationUnit tests cover uniform and quantile calculations, visualization output, public configuration, and invalid arguments.
Validation
python -m pytest python/interpret-core/tests/perf/test_curve.py python/interpret-core/tests/visual/test_plot.py -q— 10 passedCalibrationCurveimport verifiedCloses #625