Skip to content

Commit 82b8f01

Browse files
genehwungResponsible ML Infra Team
authored andcommitted
Change how the slice is stringified so it is easier to read.
From format of "FeatureA_X_FeatureB:ValueA_X_ValueB" to "FeautreA=ValueA; FeatureB=ValueB". For fairness indicator, the original behavir was kept. PiperOrigin-RevId: 446577668
1 parent 4f78c62 commit 82b8f01

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

RELEASE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
## Bug Fixes and Other Changes
1212

1313
## Breaking Changes
14+
* Changes how cross-slice is stringified for easier read: "FeatureA:ValueA__XX__FeatureB:ValueB" to "FeautreA=ValueA Vs.
15+
FeatureB=ValueB".
1416

1517
## Deprecations
1618

fairness_indicators/example_model_test.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import six
2626
import tensorflow.compat.v1 as tf
2727
import tensorflow_model_analysis as tfma
28-
from tensorflow_model_analysis.slicer import slicer_lib as slicer
2928

3029
tf.compat.v1.enable_eager_execution()
3130

@@ -96,7 +95,7 @@ def test_example_model(self):
9695
FEATURE_MAP)
9796

9897
expected_slice_keys = [
99-
'Overall', 'slice:slice3', 'slice:slice1', 'slice:slice2'
98+
'Overall', 'slice=slice3', 'slice=slice1', 'slice=slice2'
10099
]
101100
evaluation_results = tfma.load_eval_result(tfma_eval_result_path)
102101

@@ -105,7 +104,7 @@ def test_example_model(self):
105104
# Verify if false_positive_rate metrics are computed for all values of
106105
# slice.
107106
for (slice_key, metric_value) in evaluation_results.slicing_metrics:
108-
slice_key = slicer.stringify_slice_key(slice_key)
107+
slice_key = tfma.slicer.stringify_slice_key(slice_key)
109108
self.assertIn(slice_key, expected_slice_keys)
110109
self.assertGreaterEqual(
111110
1.0, metric_value['']['']

0 commit comments

Comments
 (0)