# tfdv.DatasetView

<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/utils/stats_util.py#L428-L559) |

View of statistics for a dataset (slice).

    tfdv.DatasetView(
        stats_proto: statistics_pb2.DatasetFeatureStatistics
    )

## Methods

### `get_cross_feature`

[View source](https://github.com/tensorflow/data-validation/blob/v1.16.1/tensorflow_data_validation/utils/stats_util.py#L493-L507)

    get_cross_feature(
        x_path: Union[str, https://www.tensorflow.org/tfx/data_validation/api_docs/python/tfdv/FeaturePath, Iterable[str]],
        y_path: Union[str, https://www.tensorflow.org/tfx/data_validation/api_docs/python/tfdv/FeaturePath, Iterable[str]]
    ) -> Optional['CrossFeatureView']

Retrieve a cross-feature if it exists, or None.

### `get_derived_feature`

[View source](https://github.com/tensorflow/data-validation/blob/v1.16.1/tensorflow_data_validation/utils/stats_util.py#L520-L559)

    get_derived_feature(
        deriver_name: str,
        source_paths: Sequence[https://www.tensorflow.org/tfx/data_validation/api_docs/python/tfdv/FeaturePath]
    ) -> Optional['FeatureView']

Retrieve a derived feature based on a deriver name and its inputs.

<br />

<br />

<br />

| Args ||
|---|---|
| `deriver_name` | The name of a deriver. Matches validation_derived_source deriver_name. |
| `source_paths` | Source paths for derived features. Matches validation_derived_source.source_path. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| FeatureView of derived feature. ||

<br />

<br />

<br />

<br />

| Raises ||
|---|---|
| ValueError if multiple derived features match. ||

<br />

### `get_feature`

[View source](https://github.com/tensorflow/data-validation/blob/v1.16.1/tensorflow_data_validation/utils/stats_util.py#L471-L491)

    get_feature(
        feature_id: Union[str, https://www.tensorflow.org/tfx/data_validation/api_docs/python/tfdv/FeaturePath, Iterable[str]]
    ) -> Optional['FeatureView']

Retrieve a feature if it exists.

Features specified within the underlying proto by name (instead of path) are
normalized to a length 1 path, and can be referred to as such.

<br />

<br />

<br />

| Args ||
|---|---|
| `feature_id` | A types.FeaturePath, Iterable\[str\] consisting of path steps, or a str, which is converted to a length one path. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| A FeatureView, or None if feature_id is not present. ||

<br />

### `list_cross_features`

[View source](https://github.com/tensorflow/data-validation/blob/v1.16.1/tensorflow_data_validation/utils/stats_util.py#L514-L518)

    list_cross_features() -> Iterable[Tuple[types.FeaturePath, types.FeaturePath]]

Lists cross-feature identifiers.

### `list_features`

[View source](https://github.com/tensorflow/data-validation/blob/v1.16.1/tensorflow_data_validation/utils/stats_util.py#L509-L512)

    list_features() -> Iterable[https://www.tensorflow.org/tfx/data_validation/api_docs/python/tfdv/FeaturePath]

Lists feature identifiers.

### `proto`

[View source](https://github.com/tensorflow/data-validation/blob/v1.16.1/tensorflow_data_validation/utils/stats_util.py#L467-L469)

    proto() -> statistics_pb2.DatasetFeatureStatistics

Retrieve the underlying proto.