Commit 022c7e7
authored
spec: add confusion-matrix specification (#2277)
## New Specification: `confusion-matrix`
Related to #2272
---
### specification.md
# confusion-matrix: Confusion Matrix Heatmap
## Description
A specialized heatmap visualization for evaluating classification model
performance, displaying the counts or proportions of predicted vs actual
class labels. The confusion matrix reveals true positives, false
positives, true negatives, and false negatives at a glance, making it
essential for understanding model behavior, identifying class
imbalances, and diagnosing specific misclassification patterns.
## Applications
- Binary classification model evaluation showing sensitivity and
specificity
- Multi-class classifier performance analysis with per-class accuracy
breakdown
- Model comparison to identify which classes are most often confused
- Error analysis to understand systematic misclassification patterns
## Data
- `true_labels` (categorical) - ground truth class labels for each
sample
- `predicted_labels` (categorical) - model-predicted class labels for
each sample
- `class_names` (string) - display names for each class on the axes
- Size: 2-20 classes (larger matrices may have readability issues)
- Example: Classification results from a trained model on test data
## Notes
- Label axes clearly: "True Label" (y-axis) and "Predicted Label"
(x-axis)
- Annotate cells with counts or percentages for precise interpretation
- Support normalization options: none (raw counts), by row (recall), by
column (precision), or by total
- Use sequential colormap (e.g., Blues) for count data
- Include colorbar showing the value scale
- Consider highlighting diagonal (correct predictions) for visual
clarity
---
**Next:** Add `approved` label to the issue to merge this PR.
---
:robot: *[spec-create
workflow](https://github.com/MarkusNeusinger/pyplots/actions/runs/20526498624)*
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>1 parent ef4de37 commit 022c7e7
2 files changed
Lines changed: 59 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
0 commit comments