3. Register Entities
Registering entities represented in Credit Default dataset¶
In FeatureByte, an entity models real-world objects and ideas. These entities often correspond to keys in database tables.
Taking our loan applications scenario as an example, we can view "Client", "New Application", "Prior Application", and "Loan" as entities.
To help FeatureByte identify these entities in the data and the columns that represent them, we'll be creating and tagging these entities in this tutorial.
import featurebyte as fb
# Set your profile to the tutorial environment
fb.use_profile("tutorial")
catalog_name = "Credit Default Dataset SDK Tutorial"
catalog = fb.Catalog.activate(catalog_name)
17:53:44 | INFO | Using profile: tutorial 17:53:44 | INFO | Using configuration file at: /Users/gxav/.featurebyte/config.yaml 17:53:44 | INFO | Active profile: tutorial (https://tutorials.featurebyte.com/api/v1) 17:53:44 | INFO | SDK version: 3.3.1 17:53:44 | INFO | No catalog activated. 17:53:44 | INFO | Catalog activated: Credit Default Dataset SDK Tutorial 16:05:47 | INFO | Catalog activated: Grocery Dataset Tutorial
Identify Entities in Your Data and Decide their Serving Name¶
When creating an entity, you'll need to define its serving name. This name acts as a unique identifier, particularly during preview or serving requests.
catalog.create_entity(name="New Application", serving_names=["SK_ID_CURR"])
catalog.create_entity(name="Client", serving_names=["ClientID"])
catalog.create_entity(name="BureauReportedCredit", serving_names=["SK_ID_BUREAU"])
catalog.create_entity(name="PriorApplication", serving_names=["APPLICATION_ID"])
catalog.create_entity(name="Installment", serving_names=["INSTALMENT_ID"])
catalog.create_entity(name="Loan", serving_names=["LOAN_ID"])
| name | Loan |
| created_at | 2025-12-04 09:53:46 |
| updated_at | None |
| description | None |
| serving_names | ['LOAN_ID'] |
| catalog_name | Credit Default Dataset SDK Tutorial |
Tag Columns Representing Entities¶
Now that we've established the entities, it's time to guide FeatureByte in mapping these entities to the actual data in our tables.
application = catalog.get_table("NEW_APPLICATION")
application["ClientID"].as_entity("Client")
application["SK_ID_CURR"].as_entity("New Application")
client_profile = catalog.get_table("CLIENT_PROFILE")
client_profile["ClientID"].as_entity("Client")
bureau = catalog.get_table("BUREAU")
bureau["ClientID"].as_entity("Client")
bureau["SK_ID_BUREAU"].as_entity("BureauReportedCredit")
previous_application = catalog.get_table("PREVIOUS_APPLICATION")
previous_application["ClientID"].as_entity("Client")
previous_application["APPLICATION_ID"].as_entity("PriorApplication")
loan_status = catalog.get_table("LOAN_STATUS")
loan_status["LOAN_ID"].as_entity("Loan")
loan_status['APPLICATION_ID'].as_entity("PriorApplication")
installments_payments = catalog.get_table("INSTALLMENTS_PAYMENTS")
installments_payments["INSTALMENT_ID"].as_entity("Installment")
installments_payments["APPLICATION_ID"].as_entity("PriorApplication")
credit_card_balance = catalog.get_table("CREDIT_CARD_MONTHLY_BALANCE")
credit_card_balance["ClientID"].as_entity("Client")
Review Entities Relationships¶
Now, if we list the tables as we did in the previous tutorial, we'll notice that entities have been assigned to each table.
display(catalog.list_tables())
| id | name | type | status | entities | created_at | |
|---|---|---|---|---|---|---|
| 0 | 69315a03b3208c06f266c51c | CREDIT_CARD_MONTHLY_BALANCE | time_series_table | PUBLIC_DRAFT | [Client] | 2025-12-04T09:53:08.220000 |
| 1 | 69315a02b3208c06f266c51b | LOAN_STATUS | scd_table | PUBLIC_DRAFT | [Loan, PriorApplication] | 2025-12-04T09:53:06.475000 |
| 2 | 69315a00b3208c06f266c51a | PREVIOUS_APPLICATION | event_table | PUBLIC_DRAFT | [PriorApplication, Client] | 2025-12-04T09:53:04.927000 |
| 3 | 693159feb3208c06f266c519 | INSTALLMENTS_PAYMENTS | event_table | PUBLIC_DRAFT | [Installment, PriorApplication] | 2025-12-04T09:53:03.192000 |
| 4 | 693159fdb3208c06f266c518 | BUREAU | event_table | PUBLIC_DRAFT | [Client, BureauReportedCredit] | 2025-12-04T09:53:01.457000 |
| 5 | 693159fbb3208c06f266c517 | CLIENT_PROFILE | scd_table | PUBLIC_DRAFT | [Client] | 2025-12-04T09:52:59.647000 |
| 6 | 693159f9b3208c06f266c516 | NEW_APPLICATION | dimension_table | PUBLIC_DRAFT | [New Application, Client] | 2025-12-04T09:52:57.630000 |
We can also list entities separately:
display(catalog.list_entities())
| id | name | serving_names | created_at | |
|---|---|---|---|---|
| 0 | 69315a2adb89f9149ba1ef3a | Loan | [LOAN_ID] | 2025-12-04T09:53:46.811000 |
| 1 | 69315a2adb89f9149ba1ef39 | Installment | [INSTALMENT_ID] | 2025-12-04T09:53:46.488000 |
| 2 | 69315a29db89f9149ba1ef38 | PriorApplication | [APPLICATION_ID] | 2025-12-04T09:53:46.169000 |
| 3 | 69315a29db89f9149ba1ef37 | BureauReportedCredit | [SK_ID_BUREAU] | 2025-12-04T09:53:45.816000 |
| 4 | 69315a29db89f9149ba1ef36 | Client | [ClientID] | 2025-12-04T09:53:45.477000 |
| 5 | 69315a28db89f9149ba1ef35 | New Application | [SK_ID_CURR] | 2025-12-04T09:53:45.141000 |
And let's examine the relationships between entities, which FeatureByte has conveniently outlined for us:
display(catalog.list_relationships())
| id | relationship_type | entity | related_entity | relation_table | relation_table_type | enabled | created_at | updated_at | |
|---|---|---|---|---|---|---|---|---|---|
| 0 | 69315a30da8963295e76f9a2 | child_parent | Installment | PriorApplication | INSTALLMENTS_PAYMENTS | event_table | True | 2025-12-04T09:53:52.503000 | None |
| 1 | 69315a2fda8963295e76f99a | child_parent | Loan | PriorApplication | LOAN_STATUS | scd_table | True | 2025-12-04T09:53:51.579000 | None |
| 2 | 69315a2eda8963295e76f994 | child_parent | PriorApplication | Client | PREVIOUS_APPLICATION | event_table | True | 2025-12-04T09:53:50.588000 | None |
| 3 | 69315a2dda8963295e76f98c | child_parent | BureauReportedCredit | Client | BUREAU | event_table | True | 2025-12-04T09:53:49.708000 | None |
| 4 | 69315a2cda8963295e76f984 | child_parent | New Application | Client | NEW_APPLICATION | dimension_table | True | 2025-12-04T09:53:48.123000 | None |