Gets feature values associated with given model spec fields from extracts.
tfma.model_util.get_feature_values_for_model_spec_field(
model_specs: List[tfma.ModelSpec
],
field: Text,
multi_output_field: Optional[Text],
batched_extracts: tfma.types.Extracts
,
allow_missing: bool = False
) -> Optional[Any]
Args |
model_specs
|
List of model specs from EvalConfig.
|
field
|
Name of field used to determine the feature(s) to extract. This
should be an attribute on the ModelSpec such as "label_key",
"example_weight_key", or "prediction_key".
|
multi_output_field
|
Optional name of field used to store multi-output
versions of the features. This should be an attribute on the ModelSpec
such as "label_keys", "example_weight_keys", or "prediction_keys". This
field is only used if a value at field is not found.
|
batched_extracts
|
Extracts containing batched features keyed by
tfma.FEATURES_KEY and optionally tfma.TRANSFORMED_FEATURES_KEY.
|
allow_missing
|
True if the feature may be missing (in which case None will
be used as the value).
|
Returns |
Feature values stored at given key (or feature values stored at each output
keyed by output name if field containing map of feature keys was used). If
multiple models are used the value(s) will be stored in a dict keyed by
model name. If no values are found and allow_missing is False then None
will be returned.
|