UseCase
A UseCase object formulates the modelling problem by associating a context with a target. UseCase objects facilitate the organization of your observation tables, feature tables and deployments. UseCase objects also play a crucial role in FeatureByte Copilot, enabling it to provide tailored feature suggestions.
Creating a UseCase¶
To construct a new Use Case, the following information is required:
-
Select a Context: Choose a registered Context that defines the environment of your UseCase.
-
Define a Target: Specify a registered Target that represents the goal of your UseCase.
Note
The context and target must correspond to the same entities.
Use the create()
class method to add the UseCase to the active catalog:
use_case = fb.UseCase.create(
name="Credit Card Fraud Detection",
target_name="Is Fraudulent Transaction",
context_name="New Transaction",
)
For a comprehensive use case setup, include a detailed description:
use_case.update_description(
"This use case aims to detect at an early stage credit card fraudulent transactions (any time within 30 minutes after the transaction has been processed). The detection only focuses on purchase transactions."
)
Note
You can also use the description
parameter in the create()
class method.
Providing a detailed description of the use case, context, and target ensures better documentation and enhances the effectiveness of the FeatureByte Copilot in suggesting relevant features and assessing their relevance.
Association with Observation Table¶
Once the Use Case is defined, you can link an observation table to the UseCase using the add_observation_table()
method.
use_case = catalog.get_use_case("Credit Card Fraud Detection")
use_case.add_observation_table(<observation_table_name>)
Note
Observation tables are automatically linked to a Use Case when they are derived from
- an observation table that is linked to the use case's context
- a target that is linked to the use case
You can also define an observation table to be used as the default preview / eda table for the UseCase using the update_default_eda_table()
and update_default_preview_table()
methods.
Finally, you can list observation tables associated with the UseCase using the list_observation_tables()
method.
Association with Deployment¶
Deployments associated with a use case can be listed easily using the list_deployments()
method.
Note
A deployment is associated with a use case when the use case is specified during the related feature list deployment.
Association with Feature Table¶
Feature tables associated with a use case can be listed easily using the list_feature_tables()
method.
Note
Feature tables are automatically associated with use cases via the observation tables they originate from.