TF 2.0 is out! Get hands-on practice at TF World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

tfdv.CombinerStatsGenerator

Class CombinerStatsGenerator

Generate statistics using combiner function.

This object mirrors a beam.CombineFn except for the add_input interface, which is expected to be defined by its sub-classes.

__init__

__init__(
    name,
    schema=None
)

Initializes a statistics generator.

Args:

  • name: A unique name associated with the statistics generator.
  • schema: An optional schema for the dataset.

Properties

name

schema

Methods

add_input

add_input(
    accumulator,
    input_table
)

Returns result of folding a batch of inputs into accumulator.

Args:

  • accumulator: The current accumulator.
  • input_table: An Arrow Table whose columns are features and rows are examples. The columns are of type List or Null (If a feature's value is None across all the examples in the batch, its corresponding column is of Null type).

Returns:

The accumulator after updating the statistics for the batch of inputs.

create_accumulator

create_accumulator()

Returns a fresh, empty accumulator.

Returns:

An empty accumulator.

extract_output

extract_output(accumulator)

Returns result of converting accumulator into the output value.

Args:

  • accumulator: The final accumulator value.

Returns:

A proto representing the result of this stats generator.

merge_accumulators

merge_accumulators(accumulators)

Merges several accumulators to a single accumulator value.

Args:

  • accumulators: The accumulators to merge.

Returns:

The merged accumulator.