# tfdv.TransformStatsGenerator

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/data-validation/blob/v1.16.1/tensorflow_data_validation/statistics/generators/stats_generator.py#L480-L500) |

A StatsGenerator which wraps an arbitrary Beam PTransform.

    tfdv.TransformStatsGenerator(
        name: Text,
        ptransform: beam.PTransform,
        schema: Optional[schema_pb2.Schema] = None
    ) -> None

This class computes statistics using a user-provided Beam PTransform. The
PTransform must accept a Beam PCollection where each element is a tuple
containing a slice key and an Arrow RecordBatch representing a batch of
examples. It must return a PCollection where each element is a tuple
containing a slice key and a DatasetFeatureStatistics proto representing the
statistics of a slice.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `name` | A unique name associated with the statistics generator. |
| `schema` | An optional schema for the dataset. |

<br />

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `name` | <br /> <br /> |
| `ptransform` | <br /> <br /> |
| `schema` | <br /> <br /> |

<br />