Defining a cross_column for dependent categorical features

Defining a cross_column for dependent categorical features



My features include two columns:


department


service



Because department and service are mostly "sparse" columns, they were defined as:


department


service


department_column = tf.feature_column.categorical_column_with_hash_bucket("department", 200, dtype=tf.int32)
feature_dict["department"] = tf.feature_column.indicator_column(department_column)

service_column = tf.feature_column.categorical_column_with_hash_bucket("service", 4000, dtype=tf.int32)
feature_dict["service"] = tf.feature_column.indicator_column(service_column)



But when we define this features as independent columns we're not describing the relation between this columns: service only makes sense only in the scope of particular department.


service


department



To describe the relation, it seems a good idea to use crossed columns.



The solution consist of two stages:


crossed_column


crossed_column


embedding_column


indicator_column









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Edmonton

Crossroads (UK TV series)