Skip to content

Commit 975fbed

Browse files
genehwungResponsible ML Infra Team
authored and
Responsible ML Infra Team
committed
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 0e109eb commit 975fbed

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Diff for: RELEASE.md

+2
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

Diff for: fairness_indicators/example_model_test.py

+2-3
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)