Skip to content

Commit e6fc31c

Browse files
committed
address comments + fix defaults values
1 parent 4c8117d commit e6fc31c

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

sdmetrics/single_table/data_augmentation/base.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,8 @@ def compute(
245245
metadata,
246246
prediction_column_name,
247247
minority_class_label,
248-
classifier=None,
249-
fixed_value=0.9,
248+
classifier,
249+
fixed_value,
250250
):
251251
"""Compute the score of the metric.
252252
@@ -265,10 +265,10 @@ def compute(
265265
The minority class label.
266266
classifier (str):
267267
The ML algorithm to use when building a Binary Classfication.
268-
Supported options are ``XGBoost``. Defaults to ``XGBoost``.
268+
Supported options are ``XGBoost``.
269269
fixed_value (float):
270-
A float in the range (0, 1.0) describing the value to fix for the metric to fix
271-
when building the Binary Classification model. Defaults to ``0.9``.
270+
A float value in the range (0, 1.0) that specifies the metric value
271+
to fix when building the Binary Classification model.
272272
273273
Returns:
274274
float:

sdmetrics/single_table/data_augmentation/binary_classifier_recall_efficacy.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ def compute_breakdown(
1818
metadata,
1919
prediction_column_name,
2020
minority_class_label,
21-
classifier,
22-
fixed_precision_value,
21+
classifier='XGBoost',
22+
fixed_precision_value=0.9,
2323
):
2424
"""Compute the score breakdown of the metric."""
2525
return super().compute_breakdown(
@@ -42,8 +42,8 @@ def compute(
4242
metadata,
4343
prediction_column_name,
4444
minority_class_label,
45-
classifier,
46-
fixed_precision_value,
45+
classifier='XGBoost',
46+
fixed_precision_value=0.9,
4747
):
4848
"""Compute the score of the metric.
4949
@@ -65,6 +65,7 @@ def compute(
6565
Supported options are ``XGBoost``. Defaults to ``XGBoost``.
6666
fixed_precision_value (float):
6767
The fixed precision value to be used when calculating the recall score.
68+
Defaults to 0.9.
6869
6970
Returns:
7071
float:

sdmetrics/single_table/data_augmentation/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def _validate_data_and_metadata(
104104
raise ValueError(
105105
f"The metric can't be computed because the value `{minority_class_label}` "
106106
f'is not present in the column `{prediction_column_name}` for the real validation data.'
107-
' The `precision`and `recall` are undefined for this case.'
107+
' The `precision` and `recall` are undefined for this case.'
108108
)
109109

110110
synthetic_labels = set(synthetic_data[prediction_column_name].unique())

tests/integration/single_table/data_augmentation/test_binary_classifier_precision_efficacy.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def test_with_no_minority_class_in_validation(self):
9292
real_validation['gender'] = 'M'
9393
expected_error = re.escape(
9494
"The metric can't be computed because the value `F` is not present in the column "
95-
'`gender` for the real validation data. The `precision`and `recall` are undefined'
95+
'`gender` for the real validation data. The `precision` and `recall` are undefined'
9696
' for this case.'
9797
)
9898

tests/integration/single_table/data_augmentation/test_binary_classifier_recall_efficacy.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def test_with_no_minority_class_in_validation(self):
8383
real_validation['gender'] = 'M'
8484
expected_error = re.escape(
8585
"The metric can't be computed because the value `F` is not present in the column "
86-
'`gender` for the real validation data. The `precision`and `recall` are undefined'
86+
'`gender` for the real validation data. The `precision` and `recall` are undefined'
8787
' for this case.'
8888
)
8989

0 commit comments

Comments
 (0)