tfma.extractors.FeaturesExtractor
Stay organized with collections
Save and categorize content based on your preferences.
Creates an extractor for extracting features.
tfma.extractors.FeaturesExtractor(
eval_config: tfma.EvalConfig
,
tensor_representations: Optional[Mapping[Text, schema_pb2.TensorRepresentation]] = None
) -> tfma.extractors.Extractor
The extractor acts as follows depending on the existence of certain keys
within the incoming extracts:
1) Extracts contains tfma.ARROW_RECORD_BATCH_KEY
The features stored in the RecordBatch will be extracted and added to the
output extract under the key tfma.FEATURES_KEY and the raw serialized inputs
will be added under the tfma.INPUT_KEY. Any extracts that already exist will
be merged with the values from the RecordBatch with the RecordBatch values
taking precedence when duplicate keys are detected. The
tfma.ARROW_RECORD_BATCH_KEY key will be removed from the output extracts.
2) Extracts contains tfma.FEATURES_KEY (but not tfma.ARROW_RECORD_BATCH_KEY)
The operation will be a no-op and the incoming extracts will be passed as is
to the output.
3) Extracts contains neither tfma.FEATURES_KEY | tfma.ARROW_RECORD_BATCH_KEY
An exception will be raised.
Args |
eval_config
|
Eval config.
|
tensor_representations
|
Optional tensor representations to use when parsing
the data. If tensor_representations are not passed or a representation is
not found for a given feature name a default representation will be used
where possible, otherwise an exception will be raised.
|
Returns |
Extractor for extracting features.
|
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.
Last updated 2024-04-26 UTC.
[null,null,["Last updated 2024-04-26 UTC."],[],[],null,["# tfma.extractors.FeaturesExtractor\n\n\u003cbr /\u003e\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/model-analysis/blob/v0.46.0/tensorflow_model_analysis/extractors/features_extractor.py#L36-L77) |\n\nCreates an extractor for extracting features. \n\n tfma.extractors.FeaturesExtractor(\n eval_config: ../../tfma/EvalConfig,\n tensor_representations: Optional[Mapping[Text, schema_pb2.TensorRepresentation]] = None\n ) -\u003e ../../tfma/extractors/Extractor\n\nThe extractor acts as follows depending on the existence of certain keys\nwithin the incoming extracts:\n\n1) Extracts contains tfma.ARROW_RECORD_BATCH_KEY\n\nThe features stored in the RecordBatch will be extracted and added to the\noutput extract under the key tfma.FEATURES_KEY and the raw serialized inputs\nwill be added under the tfma.INPUT_KEY. Any extracts that already exist will\nbe merged with the values from the RecordBatch with the RecordBatch values\ntaking precedence when duplicate keys are detected. The\ntfma.ARROW_RECORD_BATCH_KEY key will be removed from the output extracts.\n\n2) Extracts contains tfma.FEATURES_KEY (but not tfma.ARROW_RECORD_BATCH_KEY)\n\nThe operation will be a no-op and the incoming extracts will be passed as is\nto the output.\n\n3) Extracts contains neither tfma.FEATURES_KEY \\| tfma.ARROW_RECORD_BATCH_KEY\n\nAn exception will be raised.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|--------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `eval_config` | Eval config. |\n| `tensor_representations` | Optional tensor representations to use when parsing the data. If tensor_representations are not passed or a representation is not found for a given feature name a default representation will be used where possible, otherwise an exception will be raised. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| Extractor for extracting features. ||\n\n\u003cbr /\u003e"]]