From 07eeca2ef0a5306517914a4952900be0a517dd7d Mon Sep 17 00:00:00 2001 From: jirka Date: Mon, 3 May 2021 19:13:44 +0200 Subject: [PATCH] format --- tests/classification/test_auc.py | 8 +------- tests/classification/test_auroc.py | 12 ++++++------ tests/classification/test_cohen_kappa.py | 18 +++++++++--------- 3 files changed, 16 insertions(+), 22 deletions(-) diff --git a/tests/classification/test_auc.py b/tests/classification/test_auc.py index a086a72306e..afdf3938fb5 100644 --- a/tests/classification/test_auc.py +++ b/tests/classification/test_auc.py @@ -77,13 +77,7 @@ def test_auc_functional(self, x, y, reorder): @pytest.mark.parametrize("reorder", [True, False]) def test_auc_differentiability(self, x, y, reorder): self.run_differentiability_test( - preds=x, - target=y, - metric_module=AUC, - metric_functional=auc, - metric_args={ - "reorder": reorder - } + preds=x, target=y, metric_module=AUC, metric_functional=auc, metric_args={"reorder": reorder} ) diff --git a/tests/classification/test_auroc.py b/tests/classification/test_auroc.py index 80ddda0a3ab..d3196e1ef9d 100644 --- a/tests/classification/test_auroc.py +++ b/tests/classification/test_auroc.py @@ -89,12 +89,12 @@ def _sk_auroc_multilabel_multidim_prob(preds, target, num_classes, average='macr @pytest.mark.parametrize("average", ['macro', 'weighted', 'micro']) @pytest.mark.parametrize("max_fpr", [None, 0.8, 0.5]) @pytest.mark.parametrize( - "preds, target, sk_metric, num_classes", [ - (_input_binary_prob.preds, _input_binary_prob.target, _sk_auroc_binary_prob, 1), - (_input_mcls_prob.preds, _input_mcls_prob.target, _sk_auroc_multiclass_prob, NUM_CLASSES), - (_input_mdmc_prob.preds, _input_mdmc_prob.target, _sk_auroc_multidim_multiclass_prob, NUM_CLASSES), - (_input_mlb_prob.preds, _input_mlb_prob.target, _sk_auroc_multilabel_prob, NUM_CLASSES), - (_input_mlmd_prob.preds, _input_mlmd_prob.target, _sk_auroc_multilabel_multidim_prob, NUM_CLASSES)] + "preds, target, sk_metric, num_classes", + [(_input_binary_prob.preds, _input_binary_prob.target, _sk_auroc_binary_prob, 1), + (_input_mcls_prob.preds, _input_mcls_prob.target, _sk_auroc_multiclass_prob, NUM_CLASSES), + (_input_mdmc_prob.preds, _input_mdmc_prob.target, _sk_auroc_multidim_multiclass_prob, NUM_CLASSES), + (_input_mlb_prob.preds, _input_mlb_prob.target, _sk_auroc_multilabel_prob, NUM_CLASSES), + (_input_mlmd_prob.preds, _input_mlmd_prob.target, _sk_auroc_multilabel_multidim_prob, NUM_CLASSES)] ) class TestAUROC(MetricTester): diff --git a/tests/classification/test_cohen_kappa.py b/tests/classification/test_cohen_kappa.py index 96c6d016605..7f194a19a86 100644 --- a/tests/classification/test_cohen_kappa.py +++ b/tests/classification/test_cohen_kappa.py @@ -78,15 +78,15 @@ def _sk_cohen_kappa_multidim_multiclass(preds, target, weights=None): @pytest.mark.parametrize("weights", ['linear', 'quadratic', None]) @pytest.mark.parametrize( - "preds, target, sk_metric, num_classes", [ - (_input_binary_prob.preds, _input_binary_prob.target, _sk_cohen_kappa_binary_prob, 2), - (_input_binary.preds, _input_binary.target, _sk_cohen_kappa_binary, 2), - (_input_mlb_prob.preds, _input_mlb_prob.target, _sk_cohen_kappa_multilabel_prob, 2), - (_input_mlb.preds, _input_mlb.target, _sk_cohen_kappa_multilabel, 2), - (_input_mcls_prob.preds, _input_mcls_prob.target, _sk_cohen_kappa_multiclass_prob, NUM_CLASSES), - (_input_mcls.preds, _input_mcls.target, _sk_cohen_kappa_multiclass, NUM_CLASSES), - (_input_mdmc_prob.preds, _input_mdmc_prob.target, _sk_cohen_kappa_multidim_multiclass_prob, NUM_CLASSES), - (_input_mdmc.preds, _input_mdmc.target, _sk_cohen_kappa_multidim_multiclass, NUM_CLASSES)] + "preds, target, sk_metric, num_classes", + [(_input_binary_prob.preds, _input_binary_prob.target, _sk_cohen_kappa_binary_prob, 2), + (_input_binary.preds, _input_binary.target, _sk_cohen_kappa_binary, 2), + (_input_mlb_prob.preds, _input_mlb_prob.target, _sk_cohen_kappa_multilabel_prob, 2), + (_input_mlb.preds, _input_mlb.target, _sk_cohen_kappa_multilabel, 2), + (_input_mcls_prob.preds, _input_mcls_prob.target, _sk_cohen_kappa_multiclass_prob, NUM_CLASSES), + (_input_mcls.preds, _input_mcls.target, _sk_cohen_kappa_multiclass, NUM_CLASSES), + (_input_mdmc_prob.preds, _input_mdmc_prob.target, _sk_cohen_kappa_multidim_multiclass_prob, NUM_CLASSES), + (_input_mdmc.preds, _input_mdmc.target, _sk_cohen_kappa_multidim_multiclass, NUM_CLASSES)] ) class TestCohenKappa(MetricTester): atol = 1e-5