nerdexam
Google

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

Submitted by deeparc· Mar 30, 2026Operationalizing machine learning models

Question

Which TensorFlow function can you use to configure a categorical column if you don't know all of the possible values for that column?

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)
  • A
    2% (1)
  • B
    75% (36)
  • C
    15% (7)
  • D
    8% (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

#TensorFlow#categorical features#hash bucket#feature columns

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-DATA-ENGINEER Practice