Description Usage Arguments Value Raises See Also
View source: R/parsing_utils.R
If users keep data in tf$Example
format, they need to call tf$parse_example
with a proper feature spec. There are two main things that this utility
helps:
Users need to combine parsing spec of features with labels and weights (if
any) since they are all parsed from same tf$Example
instance. This utility
combines these specs.
It is difficult to map expected label by a regressor such as dnn_regressor
to corresponding tf$parse_example
spec. This utility encodes it by getting
related information from users (key, dtype).
1 2 3 4 5 6 7 8 | regressor_parse_example_spec(
feature_columns,
label_key,
label_dtype = tf$float32,
label_default = NULL,
label_dimension = 1L,
weight_column = NULL
)
|
feature_columns |
An iterable containing all feature columns. All items
should be instances of classes derived from |
label_key |
A string identifying the label. It means |
label_dtype |
A |
label_default |
used as label if label_key does not exist in given
|
label_dimension |
Number of regression targets per example. This is the
size of the last dimension of the labels and logits |
weight_column |
A string or a |
A dict mapping each feature key to a FixedLenFeature
or
VarLenFeature
value.
ValueError: If label is used in feature_columns
.
ValueError: If weight_column is used in feature_columns
.
ValueError: If any of the given feature_columns
is not a _FeatureColumn
instance.
ValueError: If weight_column
is not a _NumericColumn
instance.
ValueError: if label_key is NULL
.
Other parsing utilities:
classifier_parse_example_spec()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.