INVOICE Day
SDK code to create INVOICE_Day¶
Feature description:
Day of 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!
# Extract day date part from Timestamp column for GROCERYINVOICE view.
groceryinvoice_view["Day of invoice"] = groceryinvoice_view["Timestamp"].dt.day
# Extract day date part from Timestamp column for GROCERYINVOICE view.
groceryinvoice_view["Day of invoice"] = groceryinvoice_view["Timestamp"].dt.day
In [ ]:
Copied!
# Create lookup feature from Day of invoice column for invoice entity.
invoice_day =\
groceryinvoice_view["Day of invoice"].as_feature("INVOICE_Day")
# Create lookup feature from Day of invoice column for invoice entity.
invoice_day =\
groceryinvoice_view["Day of invoice"].as_feature("INVOICE_Day")
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_day.primary_entity
#Check the primary entity of the feature'
invoice_day.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 INVOICE_Day
invoice_day.preview(
preview_table
)
#Preview INVOICE_Day
invoice_day.preview(
preview_table
)
Save feature¶
In [ ]:
Copied!
# Save feature
invoice_day.save()
# Save feature
invoice_day.save()
Add description and see feature definition file¶
In [ ]:
Copied!
# Add description
invoice_day.update_description(
"Day of invoice"
)
# See feature definition file
invoice_day.definition
# Add description
invoice_day.update_description(
"Day of invoice"
)
# See feature definition file
invoice_day.definition