Skip to content

Commit 96dfcb1

Browse files
cavenesstf-data-validation-team
caveness
authored and
tf-data-validation-team
committed
Generate a weighted_num_examples stat if a weight feature is specified.
PiperOrigin-RevId: 271616964
1 parent 04883f4 commit 96dfcb1

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

RELEASE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
the default slice (validation/inference will be done using the default slice
1313
statistics).
1414
* Avoid flattening null arrays.
15+
* Set `weighted_num_examples` field in the statistics proto if a weight feature
16+
is specified.
1517

1618

1719
## Breaking Changes

tensorflow_data_validation/statistics/stats_impl.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ def _update_example_and_missing_count(
412412
weighted_num_examples -
413413
common_stats.weighted_common_stats.num_non_missing)
414414
stats.num_examples = int(num_examples)
415+
stats.weighted_num_examples = weighted_num_examples
415416

416417

417418
def _make_dataset_feature_statistics_list_proto(

tensorflow_data_validation/statistics/stats_impl_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ def add_input(self, accumulator, feature_path, feature_array):
317317
"""
318318
datasets {
319319
num_examples: 2
320+
weighted_num_examples: 3
320321
features {
321322
path {
322323
step: "a"

0 commit comments

Comments
 (0)