PROFESSIONAL-DATA-ENGINEER · Question #73
Which TensorFlow function can you use to configure a categorical column if you don't know all of the possible values for that column?
The correct answer is B. categorical_column_with_hash_bucket. Explanation/Reference: If you know the set of all possible feature values of a column and there are only a few of them, you can use categorical_column_with_vocabulary_list. Each key in the list will get assigned an auto-incremental ID starting from 0. What if we don't know the se
Question
Options
- Acategorical_column_with_vocabulary_list
- Bcategorical_column_with_hash_bucket
- Ccategorical_column_with_unknown_values
- Dsparse_column_with_keys
How the community answered
(48 responses)- A2% (1)
- B75% (36)
- C15% (7)
- D8% (4)
Explanation
Explanation/Reference: If you know the set of all possible feature values of a column and there are only a few of them, you can use categorical_column_with_vocabulary_list. Each key in the list will get assigned an auto-incremental ID starting from 0. What if we don't know the set of possible values in advance? Not a problem. We can use categorical_column_with_hash_bucket instead. What will happen is that each possible value in the feature column occupation will be hashed to an integer ID as we encounter them in training.
Topics
Community Discussion
No community discussion yet for this question.