tf.train.Features
Stay organized with collections
Save and categorize content based on your preferences.
Protocol message for describing the features
of a tf.train.Example
.
Features
are organized into categories by name. The Features
message
contains the mapping from name to tf.train.Feature
.
One item value of Features
for a movie recommendation application:
feature {
key: "age"
value { float_list {
value: 29.0
} }
}
feature {
key: "movie"
value { bytes_list {
value: "The Shawshank Redemption"
value: "Fight Club"
} }
}
feature {
key: "movie_ratings"
value { float_list {
value: 9.0
value: 9.7
} }
}
feature {
key: "suggestion"
value { bytes_list {
value: "Inception"
} }
}
feature {
key: "suggestion_purchased"
value { int64_list {
value: 1
} }
}
feature {
key: "purchase_price"
value { float_list {
value: 9.99
} }
}
Attributes |
feature
|
repeated FeatureEntry feature
|
Child Classes
class FeatureEntry
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2021-05-14 UTC.
[null,null,["Last updated 2021-05-14 UTC."],[],[],null,["# tf.train.Features\n\n\u003cbr /\u003e\n\n|---------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|\n| [TensorFlow 1 version](/versions/r1.15/api_docs/python/tf/train/Features) | [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.5.0/tensorflow/core/example/feature.proto) |\n\nProtocol message for describing the `features` of a [`tf.train.Example`](../../tf/train/Example).\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.train.Features`](https://www.tensorflow.org/api_docs/python/tf/train/Features)\n\n\u003cbr /\u003e\n\n`Features` are organized into categories by name. The `Features` message\ncontains the mapping from name to [`tf.train.Feature`](../../tf/train/Feature).\n\nOne item value of `Features` for a movie recommendation application: \n\n feature {\n key: \"age\"\n value { float_list {\n value: 29.0\n } }\n }\n feature {\n key: \"movie\"\n value { bytes_list {\n value: \"The Shawshank Redemption\"\n value: \"Fight Club\"\n } }\n }\n feature {\n key: \"movie_ratings\"\n value { float_list {\n value: 9.0\n value: 9.7\n } }\n }\n feature {\n key: \"suggestion\"\n value { bytes_list {\n value: \"Inception\"\n } }\n }\n feature {\n key: \"suggestion_purchased\"\n value { int64_list {\n value: 1\n } }\n }\n feature {\n key: \"purchase_price\"\n value { float_list {\n value: 9.99\n } }\n }\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Attributes ---------- ||\n|-----------|---------------------------------|\n| `feature` | `repeated FeatureEntry feature` |\n\n\u003cbr /\u003e\n\nChild Classes\n-------------\n\n[`class FeatureEntry`](../../tf/train/Features/FeatureEntry)"]]