CUSTOMER PostalCode
SDK code to create CUSTOMER_PostalCode¶
Feature description:
PostalCode of the customer
In [ ]:
Copied!
import featurebyte as fb
fb.use_profile("tutorial")
import featurebyte as fb
fb.use_profile("tutorial")
Activate catalog¶
In [ ]:
Copied!
catalog = fb.Catalog.activate("Grocery Dataset Tutorial")
catalog = fb.Catalog.activate("Grocery Dataset Tutorial")
Get view from table¶
In [ ]:
Copied!
# Get view from GROCERYCUSTOMER scd table.
grocerycustomer_view = catalog.get_view("GROCERYCUSTOMER")
# Get view from GROCERYCUSTOMER scd table.
grocerycustomer_view = catalog.get_view("GROCERYCUSTOMER")
In [ ]:
Copied!
# Create lookup feature from PostalCode column for customer entity.
customer_postalcode =\
grocerycustomer_view["PostalCode"].as_feature("CUSTOMER_PostalCode")
# Create lookup feature from PostalCode column for customer entity.
customer_postalcode =\
grocerycustomer_view["PostalCode"].as_feature("CUSTOMER_PostalCode")
Preview feature¶
Read on the feature primary entity concept
Read on the serving entity concept
In [ ]:
Copied!
#Check the primary entity of the feature'
customer_postalcode.primary_entity
#Check the primary entity of the feature'
customer_postalcode.primary_entity
In [ ]:
Copied!
#Get observation table: 'Preview Table with 10 Customers'
preview_table = catalog.get_observation_table(
"Preview Table with 10 Customers"
).to_pandas()
#Get observation table: 'Preview Table with 10 Customers'
preview_table = catalog.get_observation_table(
"Preview Table with 10 Customers"
).to_pandas()
In [ ]:
Copied!
#Preview CUSTOMER_PostalCode
customer_postalcode.preview(
preview_table
)
#Preview CUSTOMER_PostalCode
customer_postalcode.preview(
preview_table
)
Save feature¶
In [ ]:
Copied!
# Save feature
customer_postalcode.save()
# Save feature
customer_postalcode.save()
Add description and see feature definition file¶
In [ ]:
Copied!
# Add description
customer_postalcode.update_description(
"PostalCode of the customer"
)
# See feature definition file
customer_postalcode.definition
# Add description
customer_postalcode.update_description(
"PostalCode of the customer"
)
# See feature definition file
customer_postalcode.definition