ITEM Quantity
SDK code to create ITEM_Quantity¶
Feature description:
Quantity of the item
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 INVOICEITEMS item table.
invoiceitems_view = catalog.get_view("INVOICEITEMS")
# Get view from INVOICEITEMS item table.
invoiceitems_view = catalog.get_view("INVOICEITEMS")
In [ ]:
Copied!
# Create lookup feature from Quantity column for item entity.
item_quantity =\
invoiceitems_view["Quantity"].as_feature("ITEM_Quantity")
# Create lookup feature from Quantity column for item entity.
item_quantity =\
invoiceitems_view["Quantity"].as_feature("ITEM_Quantity")
Preview feature¶
Read on the feature primary entity concept
Read on the serving entity concept
In [ ]:
Copied!
#Check the primary entity of the feature'
item_quantity.primary_entity
#Check the primary entity of the feature'
item_quantity.primary_entity
In [ ]:
Copied!
#Get observation table: 'Preview Table with 10 items'
preview_table = catalog.get_observation_table(
"Preview Table with 10 items"
).to_pandas()
#Get observation table: 'Preview Table with 10 items'
preview_table = catalog.get_observation_table(
"Preview Table with 10 items"
).to_pandas()
In [ ]:
Copied!
#Preview ITEM_Quantity
item_quantity.preview(
preview_table
)
#Preview ITEM_Quantity
item_quantity.preview(
preview_table
)
Save feature¶
In [ ]:
Copied!
# Save feature
item_quantity.save()
# Save feature
item_quantity.save()
Add description and see feature definition file¶
In [ ]:
Copied!
# Add description
item_quantity.update_description(
"Quantity of the item"
)
# See feature definition file
item_quantity.definition
# Add description
item_quantity.update_description(
"Quantity of the item"
)
# See feature definition file
item_quantity.definition