Spaces:
Running
Running
Commit
·
9e89f62
1
Parent(s):
c0044cc
Fix: Resolve mypy type errors and configuration
Browse files- src/training/metrics.py +5 -0
src/training/metrics.py
CHANGED
|
@@ -61,6 +61,11 @@ def classification_report_dict(
|
|
| 61 |
precision, recall, f1, support = precision_recall_fscore_support(
|
| 62 |
targets, predictions, labels=labels, average=None, zero_division=0
|
| 63 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
|
| 65 |
report = {}
|
| 66 |
if labels:
|
|
|
|
| 61 |
precision, recall, f1, support = precision_recall_fscore_support(
|
| 62 |
targets, predictions, labels=labels, average=None, zero_division=0
|
| 63 |
)
|
| 64 |
+
# Type hint help for static analysis since average=None returns arrays
|
| 65 |
+
precision = cast(np.ndarray, precision)
|
| 66 |
+
recall = cast(np.ndarray, recall)
|
| 67 |
+
f1 = cast(np.ndarray, f1)
|
| 68 |
+
support = cast(np.ndarray, support)
|
| 69 |
|
| 70 |
report = {}
|
| 71 |
if labels:
|