step_numeric_column | R Documentation |
step_numeric_column
creates a numeric column specification. It can also be
used to normalize numeric columns.
step_numeric_column(
spec,
...,
shape = 1L,
default_value = NULL,
dtype = tf$float32,
normalizer_fn = NULL
)
spec |
A feature specification created with |
... |
Comma separated list of variable names to apply the step. selectors can also be used. |
shape |
An iterable of integers specifies the shape of the Tensor. An integer can be given
which means a single dimension Tensor with given width. The Tensor representing the column will
have the shape of |
default_value |
A single value compatible with |
dtype |
defines the type of values. Default value is |
normalizer_fn |
If not |
a FeatureSpec
object.
steps for a complete list of allowed steps.
Other Feature Spec Functions:
dataset_use_spec()
,
feature_spec()
,
fit.FeatureSpec()
,
step_bucketized_column()
,
step_categorical_column_with_hash_bucket()
,
step_categorical_column_with_identity()
,
step_categorical_column_with_vocabulary_file()
,
step_categorical_column_with_vocabulary_list()
,
step_crossed_column()
,
step_embedding_column()
,
step_indicator_column()
,
step_remove_column()
,
step_shared_embeddings_column()
,
steps
## Not run:
library(tfdatasets)
data(hearts)
hearts <- tensor_slices_dataset(hearts) %>% dataset_batch(32)
# use the formula interface
spec <- feature_spec(hearts, target ~ age) %>%
step_numeric_column(age, normalizer_fn = standard_scaler())
spec_fit <- fit(spec)
final_dataset <- hearts %>% dataset_use_spec(spec_fit)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.