Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save securetorobert/ad9622e151675bee9b6c65d71a2bc4e4 to your computer and use it in GitHub Desktop.
Save securetorobert/ad9622e151675bee9b6c65d71a2bc4e4 to your computer and use it in GitHub Desktop.
Create a numeric feature column
# Defaults to a tf.float32 scalar.
numeric_feature_column = tf.feature_column.numeric_column(key="SepalLength")
# Represent a tf.float64 scalar.
numeric_feature_column = tf.feature_column.numeric_column(key="SepalLength",
dtype=tf.float64)
# Represent a 10-element vector in which each cell contains a tf.float32.
vector_feature_column = tf.feature_column.numeric_column(key="Bowling",
shape=10)
# Represent a 10x5 matrix in which each cell contains a tf.float32.
matrix_feature_column = tf.feature_column.numeric_column(key="MyMatrix",
shape=[10,5])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment