Skip to content

Commit 2e8a5eb

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 43d3013 commit 2e8a5eb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

monai/metrics/confusion_matrix_patch.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def compute_confusion_matrix_metric(metric_name: str, confusion_matrix: torch.Te
221221
# calculate metric
222222
numerator: torch.Tensor
223223
denominator: torch.Tensor | float
224-
nan_tensor = torch.tensor(float("nan"), device=confusion_matrix.device)
224+
nan_tensor = torch.tensor(float("nan"), device=confusion_matrix.device)
225225

226226
"""
227227
1. tpr - True Positive Rate (Recall): The ratio of correctly predicted positive samples to the total number of samples that are actually positive.
@@ -246,7 +246,7 @@ def compute_confusion_matrix_metric(metric_name: str, confusion_matrix: torch.Te
246246
match metric:
247247
case "tpr":
248248
numerator, denominator = tp, p
249-
case "tnr": #
249+
case "tnr": #
250250
numerator, denominator = tn, n
251251
case "ppv":
252252
numerator, denominator = tp, (tp + fp)
@@ -357,4 +357,4 @@ def check_confusion_matrix_metric_name(metric_name: str) -> str:
357357
y_test = [0 ,1, 1, 1, 0, 1, 0, 1, 0, 1, 1]
358358
y_pred = [0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1]
359359

360-
print(confusion_matrix(y_test, y_pred))
360+
print(confusion_matrix(y_test, y_pred))

0 commit comments

Comments
 (0)