INVOICE Amount
SDK code to create INVOICE_Amount¶
Feature description:
Amount of the invoice
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 GROCERYINVOICE event table.
groceryinvoice_view = catalog.get_view("GROCERYINVOICE")
# Get view from GROCERYINVOICE event table.
groceryinvoice_view = catalog.get_view("GROCERYINVOICE")
In [ ]:
Copied!
# Create lookup feature from Amount column for invoice entity.
invoice_amount =\
groceryinvoice_view["Amount"].as_feature("INVOICE_Amount")
# Create lookup feature from Amount column for invoice entity.
invoice_amount =\
groceryinvoice_view["Amount"].as_feature("INVOICE_Amount")
Preview feature¶
Read on the feature primary entity concept
Read on the serving entity concept
In [ ]:
Copied!
#Check the primary entity of the feature'
invoice_amount.primary_entity
#Check the primary entity of the feature'
invoice_amount.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 INVOICE_Amount
invoice_amount.preview(
preview_table
)
#Preview INVOICE_Amount
invoice_amount.preview(
preview_table
)
Save feature¶
In [ ]:
Copied!
# Save feature
invoice_amount.save()
# Save feature
invoice_amount.save()
Add description and see feature definition file¶
In [ ]:
Copied!
# Add description
invoice_amount.update_description(
"Amount of the invoice"
)
# See feature definition file
invoice_amount.definition
# Add description
invoice_amount.update_description(
"Amount of the invoice"
)
# See feature definition file
invoice_amount.definition