Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tensorflow Feature Column for 0 and 1

For Tensorflow feature columns contain boolean value 0 and 1.

Should I be using tf.feature_column.numeric_column

or tf.feature_column.categorical_column_with_vocabulary_list?

like image 727
LYu Avatar asked Jan 18 '26 19:01

LYu


1 Answers

You can use sequence_categorical_column_with_identity :

tf.feature_column.sequence_categorical_column_with_identity('YOUR_FEATURE',2)

the second parameter is the number of buckets. If you have n consecutive integers [0,1,2 .. ,n-1] in your feature, you then write :

tf.feature_column.sequence_categorical_column_with_identity('YOUR_FEATURE',n)
like image 68
hben Avatar answered Jan 21 '26 09:01

hben