Home | History | Annotate | Download | only in estimator

Lines Matching refs:features

32 _VALID_METRIC_FN_ARGS = set(['features', 'labels', 'predictions', 'config'])
49 Example usage of custom metric which uses features:
52 def my_auc(features, labels, predictions):
54 labels, predictions['logistic'], weights=features['weight'])}
68 * features: Input `dict` of `Tensor` objects created by `input_fn` which
86 def new_model_fn(features, labels, mode, config):
87 spec = estimator.model_fn(features, labels, mode, config)
90 new_metrics = _call_metric_fn(metric_fn, features, labels, spec.predictions,
140 """Forward features to predictions dictionary.
142 In some cases, user wants to see some of the features in estimators prediction
152 features, labels = ...
153 features['unique_example_id'] = ...
154 features, labels
166 `features` in `dict` is forwarded to the `predictions`. If it is a
171 A new ${tf.estimator.Estimator} which forwards features to predictions.
177 * if 'keys' does not exist in `features`.
179 `SparseTensor` in `predictions`. `SparseTensor` is common in `features`.
197 def get_keys(features):
199 return features.keys()
202 def verify_keys_and_predictions(features, predictions):
205 'Predictions should be a dict to be able to forward features. '
207 for key in get_keys(features):
208 if key not in features:
210 'keys should be exist in features. Key "{}" is not in features '
211 'dict. features dict has following keys: {}. Please check '
212 'arguments of forward_features.'.format(key, features.keys()))
221 def new_model_fn(features, labels, mode, config): # pylint: disable=missing-docstring
222 spec = estimator.model_fn(features, labels, mode, config)
226 verify_keys_and_predictions(features, predictions)
227 for key in get_keys(features):
229 features[key])
233 'argument of forward_features to filter unwanted features. Type of '
234 'features[{}] is {}.'.format(key, key, type(feature)))
326 def _call_metric_fn(metric_fn, features, labels, predictions, config):
330 if 'features' in metric_fn_args:
331 kwargs['features'] = features