PRODUCT ProductGroup
SDK code to create PRODUCT_ProductGroup¶
Feature description:
ProductGroup of the product
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 GROCERYPRODUCT dimension table.
groceryproduct_view = catalog.get_view("GROCERYPRODUCT")
# Get view from GROCERYPRODUCT dimension table.
groceryproduct_view = catalog.get_view("GROCERYPRODUCT")
In [ ]:
Copied!
# Create lookup feature from ProductGroup column for product entity.
product_productgroup =\
groceryproduct_view["ProductGroup"].as_feature("PRODUCT_ProductGroup")
# Create lookup feature from ProductGroup column for product entity.
product_productgroup =\
groceryproduct_view["ProductGroup"].as_feature("PRODUCT_ProductGroup")
Preview feature¶
Read on the feature primary entity concept
Read on the serving entity concept
In [ ]:
Copied!
#Check the primary entity of the feature'
product_productgroup.primary_entity
#Check the primary entity of the feature'
product_productgroup.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 PRODUCT_ProductGroup
product_productgroup.preview(
preview_table
)
#Preview PRODUCT_ProductGroup
product_productgroup.preview(
preview_table
)
Save feature¶
In [ ]:
Copied!
# Save feature
product_productgroup.save()
# Save feature
product_productgroup.save()
Add description and see feature definition file¶
In [ ]:
Copied!
# Add description
product_productgroup.update_description(
"ProductGroup of the product"
)
# See feature definition file
product_productgroup.definition
# Add description
product_productgroup.update_description(
"ProductGroup of the product"
)
# See feature definition file
product_productgroup.definition