Tell us what’s happening:
hello while running this code i am getting this error as
AttributeError Traceback (most recent call last)
in <cell line: 5>()
5 for feature_name in CATEGORICAL_COLUMN:
6 vocabulary=dftrain[feature_name].unique()
----> 7 feature_column.append(tf.feature_column.numeric_column_with_vocabulary_list(feature_name,vocabulary))
8
9 for feature_name in NUMERIC_column:
AttributeError: module ‘tensorflow._api.v2.feature_column’ has no attribute ‘numeric_column_with_vocabulary_list’
can anyone help me or could provide me a source where i should continue my learning of machine learning thank you
Your code so far
CATEGORICAL_COLUMN = [‘sex’,‘n_siblings_spouses’,‘parch’,‘class’,‘deck’,‘embark_town’,‘alone’]
NUMERIC_column = [‘age’,‘fare’]
feature_column=
for feature_name in CATEGORICAL_COLUMN:
vocabulary=dftrain[feature_name].unique()
feature_column.append(tf.feature_column.numeric_column_with_vocabulary_list(feature_name,vocabulary))
for feature_name in NUMERIC_column:
feature_column.append(tf.feature_column.numeric_column(feature_name,dtype=tf.float32))
print(feature_column)
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36
Challenge: Tensorflow - Core Learning Algorithms: Training and Testing Data
Link to the challenge: