From 3029569217959e6ddb5fdd947de06a797455b64b Mon Sep 17 00:00:00 2001 From: R-Palazzo Date: Tue, 18 Mar 2025 15:07:59 +0000 Subject: [PATCH 1/4] fix --- .../data_augmentation/binary_classifier_precision_efficacy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdmetrics/single_table/data_augmentation/binary_classifier_precision_efficacy.py b/sdmetrics/single_table/data_augmentation/binary_classifier_precision_efficacy.py index 382e6615..879b04b2 100644 --- a/sdmetrics/single_table/data_augmentation/binary_classifier_precision_efficacy.py +++ b/sdmetrics/single_table/data_augmentation/binary_classifier_precision_efficacy.py @@ -18,7 +18,7 @@ def compute_breakdown( metadata, prediction_column_name, minority_class_label, - classifier='xgboost', + classifier='XGBoost', fixed_recall_value=0.9, ): """Compute the score breakdown of the metric.""" From 97f90acfdc8093339578942eaafcb4e4c0e9bbed Mon Sep 17 00:00:00 2001 From: R-Palazzo Date: Tue, 18 Mar 2025 15:08:08 +0000 Subject: [PATCH 2/4] update tests --- .../test_binary_classifier_precision_efficacy.py | 8 ++------ .../test_binary_classifier_recall_efficacy.py | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/tests/unit/single_table/data_augmentation/test_binary_classifier_precision_efficacy.py b/tests/unit/single_table/data_augmentation/test_binary_classifier_precision_efficacy.py index aad62e37..a137c3cd 100644 --- a/tests/unit/single_table/data_augmentation/test_binary_classifier_precision_efficacy.py +++ b/tests/unit/single_table/data_augmentation/test_binary_classifier_precision_efficacy.py @@ -32,8 +32,6 @@ def test_compute_breakdown(self, mock_compute_breakdown): metadata = {} prediction_column_name = 'prediction_column_name' minority_class_label = 'minority_class_label' - classifier = 'XGBoost' - fixed_recall_value = 0.8 # Run BinaryClassifierPrecisionEfficacy.compute_breakdown( @@ -43,8 +41,6 @@ def test_compute_breakdown(self, mock_compute_breakdown): metadata=metadata, prediction_column_name=prediction_column_name, minority_class_label=minority_class_label, - classifier=classifier, - fixed_recall_value=fixed_recall_value, ) # Assert @@ -55,8 +51,8 @@ def test_compute_breakdown(self, mock_compute_breakdown): metadata, prediction_column_name, minority_class_label, - classifier, - fixed_recall_value, + 'XGBoost', + 0.9, ) @patch('sdmetrics.single_table.data_augmentation.base.BaseDataAugmentationMetric.compute') diff --git a/tests/unit/single_table/data_augmentation/test_binary_classifier_recall_efficacy.py b/tests/unit/single_table/data_augmentation/test_binary_classifier_recall_efficacy.py index 350dc082..a4c3dd32 100644 --- a/tests/unit/single_table/data_augmentation/test_binary_classifier_recall_efficacy.py +++ b/tests/unit/single_table/data_augmentation/test_binary_classifier_recall_efficacy.py @@ -32,8 +32,6 @@ def test_compute_breakdown(self, mock_compute_breakdown): metadata = {} prediction_column_name = 'prediction_column_name' minority_class_label = 'minority_class_label' - classifier = 'XGBoost' - fixed_precision_value = 0.8 # Run BinaryClassifierRecallEfficacy.compute_breakdown( @@ -43,8 +41,6 @@ def test_compute_breakdown(self, mock_compute_breakdown): metadata=metadata, prediction_column_name=prediction_column_name, minority_class_label=minority_class_label, - classifier=classifier, - fixed_precision_value=fixed_precision_value, ) # Assert @@ -55,8 +51,8 @@ def test_compute_breakdown(self, mock_compute_breakdown): metadata, prediction_column_name, minority_class_label, - classifier, - fixed_precision_value, + 'XGBoost', + 0.8, ) @patch('sdmetrics.single_table.data_augmentation.base.BaseDataAugmentationMetric.compute') From 843e74f40e28300e1061bc99cd9ce3949dc4a7e3 Mon Sep 17 00:00:00 2001 From: R-Palazzo Date: Tue, 18 Mar 2025 15:13:22 +0000 Subject: [PATCH 3/4] integration tests + pin xgboost --- .../test_binary_classifier_precision_efficacy.py | 2 -- .../data_augmentation/test_binary_classifier_recall_efficacy.py | 2 -- 2 files changed, 4 deletions(-) diff --git a/tests/integration/single_table/data_augmentation/test_binary_classifier_precision_efficacy.py b/tests/integration/single_table/data_augmentation/test_binary_classifier_precision_efficacy.py index 7459ee4a..5c7c14ad 100644 --- a/tests/integration/single_table/data_augmentation/test_binary_classifier_precision_efficacy.py +++ b/tests/integration/single_table/data_augmentation/test_binary_classifier_precision_efficacy.py @@ -25,8 +25,6 @@ def test_end_to_end(self): metadata=metadata, prediction_column_name='gender', minority_class_label='F', - classifier='XGBoost', - fixed_recall_value=0.8, ) score = BinaryClassifierPrecisionEfficacy.compute( diff --git a/tests/integration/single_table/data_augmentation/test_binary_classifier_recall_efficacy.py b/tests/integration/single_table/data_augmentation/test_binary_classifier_recall_efficacy.py index 66c40dee..c39f2d59 100644 --- a/tests/integration/single_table/data_augmentation/test_binary_classifier_recall_efficacy.py +++ b/tests/integration/single_table/data_augmentation/test_binary_classifier_recall_efficacy.py @@ -43,8 +43,6 @@ def test_end_to_end(self): metadata=metadata, prediction_column_name='gender', minority_class_label='F', - classifier='XGBoost', - fixed_precision_value=0.8, ) score = BinaryClassifierRecallEfficacy.compute( From 03ca135f5a30a4cb79adbba10c45ae5bd7b44d33 Mon Sep 17 00:00:00 2001 From: R-Palazzo Date: Tue, 18 Mar 2025 15:25:57 +0000 Subject: [PATCH 4/4] fix tests --- .../test_binary_classifier_precision_efficacy.py | 1 + .../data_augmentation/test_binary_classifier_recall_efficacy.py | 1 + .../data_augmentation/test_binary_classifier_recall_efficacy.py | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/integration/single_table/data_augmentation/test_binary_classifier_precision_efficacy.py b/tests/integration/single_table/data_augmentation/test_binary_classifier_precision_efficacy.py index 5c7c14ad..836d978d 100644 --- a/tests/integration/single_table/data_augmentation/test_binary_classifier_precision_efficacy.py +++ b/tests/integration/single_table/data_augmentation/test_binary_classifier_precision_efficacy.py @@ -25,6 +25,7 @@ def test_end_to_end(self): metadata=metadata, prediction_column_name='gender', minority_class_label='F', + fixed_recall_value=0.8, ) score = BinaryClassifierPrecisionEfficacy.compute( diff --git a/tests/integration/single_table/data_augmentation/test_binary_classifier_recall_efficacy.py b/tests/integration/single_table/data_augmentation/test_binary_classifier_recall_efficacy.py index c39f2d59..60bf2a54 100644 --- a/tests/integration/single_table/data_augmentation/test_binary_classifier_recall_efficacy.py +++ b/tests/integration/single_table/data_augmentation/test_binary_classifier_recall_efficacy.py @@ -43,6 +43,7 @@ def test_end_to_end(self): metadata=metadata, prediction_column_name='gender', minority_class_label='F', + fixed_precision_value=0.8, ) score = BinaryClassifierRecallEfficacy.compute( diff --git a/tests/unit/single_table/data_augmentation/test_binary_classifier_recall_efficacy.py b/tests/unit/single_table/data_augmentation/test_binary_classifier_recall_efficacy.py index a4c3dd32..7e51a058 100644 --- a/tests/unit/single_table/data_augmentation/test_binary_classifier_recall_efficacy.py +++ b/tests/unit/single_table/data_augmentation/test_binary_classifier_recall_efficacy.py @@ -52,7 +52,7 @@ def test_compute_breakdown(self, mock_compute_breakdown): prediction_column_name, minority_class_label, 'XGBoost', - 0.8, + 0.9, ) @patch('sdmetrics.single_table.data_augmentation.base.BaseDataAugmentationMetric.compute')