column_categorical_weighted: Construct a Weighted Categorical Column

Description Usage Arguments Value Raises See Also

View source: R/feature_columns.R

Description

Use this when each of your sparse inputs has both an ID and a value. For example, if you're representing text documents as a collection of word frequencies, you can provide 2 parallel sparse input features ('terms' and 'frequencies' below).

Usage

1
2
3
4
5
column_categorical_weighted(
  categorical_column,
  weight_feature_key,
  dtype = tf$float32
)

Arguments

categorical_column

A categorical column created by column_categorical_*() functions.

weight_feature_key

String key for weight values.

dtype

Type of weights, such as tf$float32. Only float and integer weights are supported.

Value

A categorical column composed of two sparse features: one represents id, the other represents weight (value) of the id feature in that example.

Raises

See Also

Other feature column constructors: column_bucketized(), column_categorical_with_hash_bucket(), column_categorical_with_identity(), column_categorical_with_vocabulary_file(), column_categorical_with_vocabulary_list(), column_crossed(), column_embedding(), column_numeric(), input_layer()


tfestimators documentation built on Aug. 10, 2021, 1:06 a.m.