Commit 95e3f29
authored
spec: add precision-recall specification (#2279)
## New Specification: `precision-recall`
Related to #2274
---
### specification.md
# precision-recall: Precision-Recall Curve
## Description
A Precision-Recall curve plots precision (positive predictive value)
against recall (sensitivity) at various classification thresholds. This
visualization is essential for evaluating binary classifiers on
imbalanced datasets where accuracy alone is misleading. The area under
the curve (Average Precision) summarizes classifier performance, with
higher values indicating better performance.
## Applications
- Evaluating fraud detection models where fraudulent transactions are
rare compared to legitimate ones
- Assessing medical diagnostic systems where correctly identifying
positive cases (high recall) is critical
- Comparing information retrieval systems for document search relevance
ranking
- Optimizing spam filters to balance catching spam (recall) with
minimizing false positives (precision)
## Data
- `y_true` (binary array) - Ground truth binary labels (0 or 1)
- `y_scores` (numeric array) - Predicted probabilities or decision
function scores from classifier
- Size: 100-10000 samples typical for evaluation
- Example: Binary classification predictions from sklearn classifier
with `predict_proba()` output
## Notes
- Display Average Precision (AP) score in legend or annotation
- Include baseline reference line showing random classifier performance
(horizontal line at positive class ratio)
- Use stepped line style to accurately represent threshold-based curve
- Consider showing iso-F1 curves as contour lines for F1 score reference
- For multiple classifiers comparison, use distinct colors with clear
legend
---
**Next:** Add `approved` label to the issue to merge this PR.
---
:robot: *[spec-create
workflow](https://github.com/MarkusNeusinger/pyplots/actions/runs/20526505250)*
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>1 parent 022c7e7 commit 95e3f29
2 files changed
Lines changed: 60 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 | + | |
| 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 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
0 commit comments