C2W3_Assignment - change variable to Categorical

I am trying to change to Categorical, but there is no change:

tfdv.set_domain(schema,‘Cover_Type’, schema_pb2.IntDomain(name=‘Cover_Type’, min=0, max=6, is_categorical=True))

Hi! Can you let us know what you mean by having no change? Your code looks correct and Cover Type should now be in the Categorical section when you regenerate the statistics in a later section. You can also expect the Schema to show 'Cover_Type' INT required single [0,6]. Hope this helps!

What got me confused is that setting is_categorical=True does not modify the results presented by tfdv.display_schema(schema=schema) , they are the same if we don’t add this parameter.
Only later when running context.show(statistics_gen_updated.outputs[‘statistics’]) , the variable is presented explicitely as Categorical.


Hi! Yes the schema table display does not show if a variable is categorical. Perhaps this can be a feature request for future versions of TFX.

Glad to help!