Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

column_categorical_weighted

Construct a Weighted Categorical Column


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

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

  • ValueError: if dtype is not convertible to float.

See Also


tfestimators

Interface to 'TensorFlow' Estimators

v1.9.1
Apache License 2.0
Authors
JJ Allaire [aut], Yuan Tang [aut] (<https://orcid.org/0000-0001-5243-233X>), Kevin Ushey [aut], Kevin Kuo [aut, cre] (<https://orcid.org/0000-0001-7803-7901>), Daniel Falbel [ctb, cph], RStudio [cph, fnd], Google Inc. [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.