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)
16:58:25 | INFO | SDK version: 3.2.0.dev66 INFO :featurebyte:SDK version: 3.2.0.dev66 16:58:25 | INFO | No catalog activated. INFO :featurebyte:No catalog activated. 16:58:25 | INFO | Using profile: staging INFO :featurebyte:Using profile: staging 16:58:25 | INFO | Using configuration file at: /Users/gxav/.featurebyte/config.yaml INFO :featurebyte:Using configuration file at: /Users/gxav/.featurebyte/config.yaml 16:58:25 | INFO | Active profile: staging (https://staging.featurebyte.com/api/v1) INFO :featurebyte:Active profile: staging (https://staging.featurebyte.com/api/v1) 16:58:25 | INFO | SDK version: 3.2.0.dev66 INFO :featurebyte:SDK version: 3.2.0.dev66 16:58:25 | INFO | No catalog activated. INFO :featurebyte:No catalog activated. 16:58:25 | INFO | Catalog activated: Credit Default Dataset SDK Tutorial INFO :featurebyte.api.catalog:Catalog activated: Credit Default Dataset SDK Tutorial 16:05:47 | WARNING | Remote SDK version (1.1.0.dev7) is different from local (1.1.0.dev1). Update local SDK to avoid unexpected behavior. 16:05:47 | INFO | No catalog activated. 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-10-15 08:58:26 |
| 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 | 68ef62086b88234729580944 | CREDIT_CARD_MONTHLY_BALANCE | time_series_table | PUBLIC_DRAFT | [Client] | 2025-10-15T08:57:44.900000 |
| 1 | 68ef62076b88234729580943 | LOAN_STATUS | scd_table | PUBLIC_DRAFT | [Loan, PriorApplication] | 2025-10-15T08:57:43.345000 |
| 2 | 68ef62056b88234729580942 | PREVIOUS_APPLICATION | event_table | PUBLIC_DRAFT | [PriorApplication, Client] | 2025-10-15T08:57:41.795000 |
| 3 | 68ef62016b88234729580941 | INSTALLMENTS_PAYMENTS | event_table | PUBLIC_DRAFT | [Installment, PriorApplication] | 2025-10-15T08:57:37.317000 |
| 4 | 68ef61ff6b88234729580940 | BUREAU | event_table | PUBLIC_DRAFT | [Client, BureauReportedCredit] | 2025-10-15T08:57:35.734000 |
| 5 | 68ef61fe6b8823472958093f | CLIENT_PROFILE | scd_table | PUBLIC_DRAFT | [Client] | 2025-10-15T08:57:34.202000 |
| 6 | 68ef61fc6b8823472958093e | NEW_APPLICATION | dimension_table | PUBLIC_DRAFT | [New Application, Client] | 2025-10-15T08:57:32.452000 |
We can also list entities separately:
display(catalog.list_entities())
| id | name | serving_names | created_at | |
|---|---|---|---|---|
| 0 | 68ef62326bb594c3d5cc80b9 | Loan | [LOAN_ID] | 2025-10-15T08:58:26.443000 |
| 1 | 68ef62326bb594c3d5cc80b8 | Installment | [INSTALMENT_ID] | 2025-10-15T08:58:26.282000 |
| 2 | 68ef62316bb594c3d5cc80b7 | PriorApplication | [APPLICATION_ID] | 2025-10-15T08:58:26.128000 |
| 3 | 68ef62316bb594c3d5cc80b6 | BureauReportedCredit | [SK_ID_BUREAU] | 2025-10-15T08:58:25.966000 |
| 4 | 68ef62316bb594c3d5cc80b5 | Client | [ClientID] | 2025-10-15T08:58:25.803000 |
| 5 | 68ef62316bb594c3d5cc80b4 | New Application | [SK_ID_CURR] | 2025-10-15T08:58:25.635000 |
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 | 68ef6235b5826853a69c9ca8 | child_parent | Installment | PriorApplication | INSTALLMENTS_PAYMENTS | event_table | True | 2025-10-15T08:58:29.854000 | None |
| 1 | 68ef62354cbe9385fb0bdb9a | child_parent | Loan | PriorApplication | LOAN_STATUS | scd_table | True | 2025-10-15T08:58:29.302000 | None |
| 2 | 68ef6234cf8a902261e4385d | child_parent | PriorApplication | Client | PREVIOUS_APPLICATION | event_table | True | 2025-10-15T08:58:28.715000 | None |
| 3 | 68ef62344cbe9385fb0bdb94 | child_parent | BureauReportedCredit | Client | BUREAU | event_table | True | 2025-10-15T08:58:28.148000 | None |
| 4 | 68ef6233b5826853a69c9ca2 | child_parent | New Application | Client | NEW_APPLICATION | dimension_table | True | 2025-10-15T08:58:27.202000 | None |