<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/transform/blob/v1.21.0/tensorflow_transform/tf_metadata/dataset_metadata.py#L26-L65) |

Metadata about a dataset used for the "instance dict" format.

    tft.DatasetMetadata(
        schema: schema_pb2.Schema
    )

### Used in the notebooks

| Used in the tutorials |
|---|
| - [Preprocessing data with TensorFlow Transform](https://www.tensorflow.org/tfx/tutorials/transform/census) - [](https://www.tensorflow.org/tfx/transform/get_started) |

> [!CAUTION]
> **Caution:** The "instance dict" format used with `DatasetMetadata` is much less efficient than TFXIO. For any serious workloads you should use TFXIO with a [`tfxio.TensorAdapterConfig`](https://www.tensorflow.org/tfx/tfx_bsl/api_docs/python/tfx_bsl/public/tfxio/TensorAdapterConfig) instance as the metadata. Refer to [Get started with TF-Transform](https://www.tensorflow.org/tfx/transform/get_started#data_formats_and_schema) for more details.

This is an in-memory representation that may be serialized and deserialized to
and from a variety of disk representations.

<br />

<br />

<br />

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

<br />

## Methods

### `from_feature_spec`

[View source](https://github.com/tensorflow/transform/blob/v1.21.0/tensorflow_transform/tf_metadata/dataset_metadata.py#L43-L50)

    @classmethod
    from_feature_spec(
        feature_spec: Mapping[str, common_types.FeatureSpecType],
        domains: Optional[Mapping[str, common_types.DomainType]] = None
    ) -> _DatasetMetadataType

Creates a DatasetMetadata from a TF feature spec dict.

### `__eq__`

[View source](https://github.com/tensorflow/transform/blob/v1.21.0/tensorflow_transform/tf_metadata/dataset_metadata.py#L56-L59)

    __eq__(
        other
    )

Return self==value.

### `__ne__`

[View source](https://github.com/tensorflow/transform/blob/v1.21.0/tensorflow_transform/tf_metadata/dataset_metadata.py#L61-L62)

    __ne__(
        other
    )

Return self!=value.