@@ -104,13 +104,6 @@ def _get_default_thresholds(cls) -> "NumericalDriftMetrics":
104
104
normalized_wasserstein_distance = 0.1 ,
105
105
)
106
106
107
- @classmethod
108
- def defaults (cls ) -> "NumericalDriftMetrics" :
109
- return cls ._get_default_thresholds ()
110
-
111
- def get_name_and_threshold (self ) -> Tuple :
112
- return self ._find_name_and_threshold ()
113
-
114
107
115
108
class CategoricalDriftMetrics (RestTranslatableMixin ):
116
109
"""Categorical Drift Metrics
@@ -169,10 +162,6 @@ def _get_default_thresholds(cls) -> "CategoricalDriftMetrics":
169
162
jensen_shannon_distance = 0.1 ,
170
163
)
171
164
172
- @classmethod
173
- def defaults (cls ) -> "CategoricalDriftMetrics" :
174
- return cls ._get_default_thresholds ()
175
-
176
165
def get_name_and_threshold (self ) -> Tuple :
177
166
return self ._find_name_and_threshold ()
178
167
@@ -204,15 +193,15 @@ def __init__(
204
193
def _to_rest_object (self ) -> DataDriftMetricThresholdBase :
205
194
thresholds = []
206
195
if self .numerical :
207
- num_metric_name , num_threshold = self .numerical .get_name_and_threshold ()
196
+ num_metric_name , num_threshold = self .numerical ._find_name_and_threshold ()
208
197
thresholds .append (
209
198
NumericalDataDriftMetricThreshold (
210
199
metric = snake_to_camel (num_metric_name ),
211
200
threshold = num_threshold ,
212
201
)
213
202
)
214
203
if self .categorical :
215
- cat_metric_name , cat_threshold = self .categorical .get_name_and_threshold ()
204
+ cat_metric_name , cat_threshold = self .categorical ._find_name_and_threshold ()
216
205
thresholds .append (
217
206
CategoricalDataDriftMetricThreshold (
218
207
metric = snake_to_camel (cat_metric_name ),
@@ -244,8 +233,8 @@ def _from_rest_object(cls, obj: DataDriftMetricThresholdBase) -> "DataDriftMetri
244
233
@classmethod
245
234
def _get_default_thresholds (cls ) -> "DataDriftMetricThreshold" :
246
235
return cls (
247
- numerical = NumericalDriftMetrics .defaults (),
248
- categorical = CategoricalDriftMetrics .defaults (),
236
+ numerical = NumericalDriftMetrics ._get_default_thresholds (),
237
+ categorical = CategoricalDriftMetrics ._get_default_thresholds (),
249
238
)
250
239
251
240
def __eq__ (self , other : Any ) -> bool :
@@ -279,15 +268,15 @@ def __init__(
279
268
def _to_rest_object (self ) -> PredictionDriftMetricThresholdBase :
280
269
thresholds = []
281
270
if self .numerical :
282
- num_metric_name , num_threshold = self .numerical .get_name_and_threshold ()
271
+ num_metric_name , num_threshold = self .numerical ._find_name_and_threshold ()
283
272
thresholds .append (
284
273
NumericalPredictionDriftMetricThreshold (
285
274
metric = snake_to_camel (num_metric_name ),
286
275
threshold = num_threshold ,
287
276
)
288
277
)
289
278
if self .categorical :
290
- cat_metric_name , cat_threshold = self .categorical .get_name_and_threshold ()
279
+ cat_metric_name , cat_threshold = self .categorical ._find_name_and_threshold ()
291
280
thresholds .append (
292
281
CategoricalPredictionDriftMetricThreshold (
293
282
metric = snake_to_camel (cat_metric_name ),
@@ -319,8 +308,8 @@ def _from_rest_object(cls, obj: PredictionDriftMetricThresholdBase) -> "Predicti
319
308
@classmethod
320
309
def _get_default_thresholds (cls ) -> "PredictionDriftMetricThreshold" :
321
310
return cls (
322
- numerical = NumericalDriftMetrics .defaults (),
323
- categorical = CategoricalDriftMetrics .defaults (),
311
+ numerical = NumericalDriftMetrics ._get_default_thresholds (),
312
+ categorical = CategoricalDriftMetrics ._get_default_thresholds (),
324
313
)
325
314
326
315
def __eq__ (self , other : Any ) -> bool :
@@ -404,10 +393,6 @@ def _get_default_thresholds(cls) -> "DataQualityMetricsNumerical":
404
393
out_of_bounds_rate = 0.0 ,
405
394
)
406
395
407
- @classmethod
408
- def defaults (cls ) -> "DataQualityMetricsNumerical" :
409
- return cls ._get_default_thresholds ()
410
-
411
396
412
397
class DataQualityMetricsCategorical (RestTranslatableMixin ):
413
398
"""Data Quality Categorical Metrics
@@ -480,10 +465,6 @@ def _get_default_thresholds(cls) -> "DataQualityMetricsCategorical":
480
465
out_of_bounds_rate = 0.0 ,
481
466
)
482
467
483
- @classmethod
484
- def defaults (cls ) -> "DataQualityMetricsCategorical" :
485
- return cls ._get_default_thresholds ()
486
-
487
468
488
469
class DataQualityMetricThreshold (MetricThreshold ):
489
470
"""Data quality metric threshold
0 commit comments