@@ -89,6 +89,12 @@ message SlicingSpec {
89
89
map <string , string > feature_values = 2 ;
90
90
}
91
91
92
+ // Cross slicing specification.
93
+ message CrossSlicingSpec {
94
+ SlicingSpec baseline_spec = 1 ;
95
+ repeated SlicingSpec slicing_specs = 2 ;
96
+ }
97
+
92
98
// Options for aggregating multi-class / multi-label outputs.
93
99
//
94
100
// When used the associated MetricSpec metrics must be binary classification
@@ -211,6 +217,17 @@ message PerSliceMetricThresholds {
211
217
repeated PerSliceMetricThreshold thresholds = 1 ;
212
218
}
213
219
220
+ // Cross slice metric threshold.
221
+ message CrossSliceMetricThreshold {
222
+ // A list of cross slicing specs to apply threshold to.
223
+ repeated CrossSlicingSpec cross_slicing_specs = 1 ;
224
+ MetricThreshold threshold = 2 ;
225
+ }
226
+
227
+ message CrossSliceMetricThresholds {
228
+ repeated CrossSliceMetricThreshold thresholds = 1 ;
229
+ }
230
+
214
231
// Metric configuration.
215
232
message MetricConfig {
216
233
// Name of a class derived for either tf.keras.metrics.Metric or
@@ -231,6 +248,8 @@ message MetricConfig {
231
248
MetricThreshold threshold = 4 ;
232
249
// Optional thresholds for model validation using specific slices.
233
250
repeated PerSliceMetricThreshold per_slice_thresholds = 5 ;
251
+ // Optional thresholds for model validation across slices.
252
+ repeated CrossSliceMetricThreshold cross_slice_thresholds = 6 ;
234
253
}
235
254
236
255
// Metrics specification.
@@ -266,6 +285,9 @@ message MetricsSpec {
266
285
// Optional thresholds for model validation using specific slices (keyed by
267
286
// the associated metric name - e.g. 'auc', etc).
268
287
map <string , PerSliceMetricThresholds > per_slice_thresholds = 8 ;
288
+ // Optional thresholds for model validation across slices (keyed by the
289
+ // associated metric name - e.g. 'auc', etc).
290
+ map <string , CrossSliceMetricThresholds > cross_slice_thresholds = 9 ;
269
291
}
270
292
271
293
// Additional configuration options.
@@ -319,6 +341,11 @@ message EvalConfig {
319
341
// Slices for all values in feature "country" crossed with value
320
342
// "age:20".
321
343
repeated SlicingSpec slicing_specs = 4 ;
344
+ // A list of cross slicing specs where each spec represents a pair of slices
345
+ // whose associated outputs should be compared. By default slices will be
346
+ // created for both slicing_spec and baseline_spec if they do not already
347
+ // exist in slicing_specs.
348
+ repeated CrossSlicingSpec cross_slicing_specs = 8 ;
322
349
// Metrics specifications.
323
350
repeated MetricsSpec metrics_specs = 5 ;
324
351
// Additional configuration options.
0 commit comments