Commit e6fc31c 1 parent 4c8117d commit e6fc31c Copy full SHA for e6fc31c
File tree 5 files changed +13
-12
lines changed
sdmetrics/single_table/data_augmentation
tests/integration/single_table/data_augmentation
5 files changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -245,8 +245,8 @@ def compute(
245
245
metadata ,
246
246
prediction_column_name ,
247
247
minority_class_label ,
248
- classifier = None ,
249
- fixed_value = 0.9 ,
248
+ classifier ,
249
+ fixed_value ,
250
250
):
251
251
"""Compute the score of the metric.
252
252
@@ -265,10 +265,10 @@ def compute(
265
265
The minority class label.
266
266
classifier (str):
267
267
The ML algorithm to use when building a Binary Classfication.
268
- Supported options are ``XGBoost``. Defaults to ``XGBoost``.
268
+ Supported options are ``XGBoost``.
269
269
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.
272
272
273
273
Returns:
274
274
float:
Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ def compute_breakdown(
18
18
metadata ,
19
19
prediction_column_name ,
20
20
minority_class_label ,
21
- classifier ,
22
- fixed_precision_value ,
21
+ classifier = 'XGBoost' ,
22
+ fixed_precision_value = 0.9 ,
23
23
):
24
24
"""Compute the score breakdown of the metric."""
25
25
return super ().compute_breakdown (
@@ -42,8 +42,8 @@ def compute(
42
42
metadata ,
43
43
prediction_column_name ,
44
44
minority_class_label ,
45
- classifier ,
46
- fixed_precision_value ,
45
+ classifier = 'XGBoost' ,
46
+ fixed_precision_value = 0.9 ,
47
47
):
48
48
"""Compute the score of the metric.
49
49
@@ -65,6 +65,7 @@ def compute(
65
65
Supported options are ``XGBoost``. Defaults to ``XGBoost``.
66
66
fixed_precision_value (float):
67
67
The fixed precision value to be used when calculating the recall score.
68
+ Defaults to 0.9.
68
69
69
70
Returns:
70
71
float:
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ def _validate_data_and_metadata(
104
104
raise ValueError (
105
105
f"The metric can't be computed because the value `{ minority_class_label } ` "
106
106
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.'
108
108
)
109
109
110
110
synthetic_labels = set (synthetic_data [prediction_column_name ].unique ())
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ def test_with_no_minority_class_in_validation(self):
92
92
real_validation ['gender' ] = 'M'
93
93
expected_error = re .escape (
94
94
"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'
96
96
' for this case.'
97
97
)
98
98
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ def test_with_no_minority_class_in_validation(self):
83
83
real_validation ['gender' ] = 'M'
84
84
expected_error = re .escape (
85
85
"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'
87
87
' for this case.'
88
88
)
89
89
You can’t perform that action at this time.
0 commit comments