Skip to content

Commit

Permalink
Add threshold value limits for multiclass metrics (#411)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikml committed Jul 29, 2024
1 parent 0750630 commit a954428
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions nannyml/performance_estimation/confidence_based/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -2326,6 +2326,8 @@ def __init__(
chunker=chunker,
threshold=threshold,
components=[('ROC AUC', 'roc_auc')],
lower_threshold_value_limit=0,
upper_threshold_value_limit=1,
)
self.y_pred_proba: Dict[str, str]
self.classes: List[str] = [""]
Expand Down Expand Up @@ -2463,6 +2465,8 @@ def __init__(
chunker=chunker,
threshold=threshold,
components=[('F1', 'f1')],
lower_threshold_value_limit=0,
upper_threshold_value_limit=1,
)

# sampling error:
Expand Down Expand Up @@ -2577,6 +2581,8 @@ def __init__(
chunker=chunker,
threshold=threshold,
components=[('Precision', 'precision')],
lower_threshold_value_limit=0,
upper_threshold_value_limit=1,
)

# sampling error
Expand Down Expand Up @@ -2692,6 +2698,8 @@ def __init__(
chunker=chunker,
threshold=threshold,
components=[('Recall', 'recall')],
lower_threshold_value_limit=0,
upper_threshold_value_limit=1,
)

# sampling error
Expand Down Expand Up @@ -2807,6 +2815,8 @@ def __init__(
chunker=chunker,
threshold=threshold,
components=[('Specificity', 'specificity')],
lower_threshold_value_limit=0,
upper_threshold_value_limit=1,
)

# sampling error
Expand Down Expand Up @@ -2927,6 +2937,8 @@ def __init__(
chunker=chunker,
threshold=threshold,
components=[('Accuracy', 'accuracy')],
lower_threshold_value_limit=0,
upper_threshold_value_limit=1,
)

# sampling error
Expand Down Expand Up @@ -3356,6 +3368,8 @@ def __init__(
chunker=chunker,
threshold=threshold,
components=[('Average Precision', 'average_precision')],
lower_threshold_value_limit=0,
upper_threshold_value_limit=1,
)
# FIXME: Should we check the y_pred_proba argument here to ensure it's a dict?
self.y_pred_proba: Dict[str, str]
Expand Down

0 comments on commit a954428

Please sign in to comment.