I have multiple feature columns in TensorFlow and I am trying to create the loop to avoid manual typing to create feature column but its not working. Below is the list of all the columns which I need to create feature columns(this is just a dummy data, but what if we have hundreds of columns).
num_preg = tf.feature_column.numeric_column('Number_pregnant')
glucose_conc = tf.feature_column.numeric_column('glucose_concentration')
blood_prs = tf.feature_column.numeric_column('blood_pressure')
Tricep = tf.feature_column.numeric_column('Triceps')
insulin = tf.feature_column.numeric_column('Insulin')
I created a loop for this as mentioned below, df_col_num is a list containing the column names for which I need to create feature column.
for col in df_col_num:
col= tf.feature_column.categorical_column_with_hash_bucket(col,hash_bucke[enter link description here][1]t_size=50)
Any help or suggestions would be appreciated.
Thanks !