CUSTOMER Gender
SDK code to create CUSTOMER_Gender¶
Feature description:
Gender 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 Gender column for customer entity.
customer_gender =\
grocerycustomer_view["Gender"].as_feature("CUSTOMER_Gender")
# Create lookup feature from Gender column for customer entity.
customer_gender =\
grocerycustomer_view["Gender"].as_feature("CUSTOMER_Gender")
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_gender.primary_entity
#Check the primary entity of the feature'
customer_gender.primary_entity
In [ ]:
Copied!
#Get observation table: 'Preview Table with 10 items'
preview_table = catalog.get_observation_table(
"Preview Table with 10 items"
)
#Get observation table: 'Preview Table with 10 items'
preview_table = catalog.get_observation_table(
"Preview Table with 10 items"
)
In [ ]:
Copied!
#Preview CUSTOMER_Gender
customer_gender.preview(
preview_table
)
#Preview CUSTOMER_Gender
customer_gender.preview(
preview_table
)
Save feature¶
In [ ]:
Copied!
# Save feature
customer_gender.save()
# Save feature
customer_gender.save()
Add description and see feature definition file¶
In [ ]:
Copied!
# Add description
customer_gender.update_description(
"Gender of the customer"
)
# See feature definition file
customer_gender.definition
# Add description
customer_gender.update_description(
"Gender of the customer"
)
# See feature definition file
customer_gender.definition