Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add threshold value limits for multiclass metrics #411

Merged
merged 1 commit into from
Jul 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading