Join the SIG TFX-Addons community and help make TFX even better! Join SIG TFX-Addons

tfma.model_util.get_feature_values_for_model_spec_field

Gets feature values associated with given model spec fields from extracts.

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).

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.