{
"cells": [
{
"cell_type": "markdown",
"id": "0e8be874",
"metadata": {},
"source": [
"### Compute historical feature values\n",
"\n",
"Historical feature values are needed to train and test Machine Learning models. \n",
"\n",
"Let's take the feature list we just created and compute feature values for a given observation table."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "e6475ae1",
"metadata": {
"tags": []
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"\u001b[32;20m16:45:03\u001b[0m | \u001b[1m\u001b[38;20mINFO \u001b[0m\u001b[0m | \u001b[1m\u001b[38;20mUsing configuration file at: /Users/viktor/.featurebyte/config.yaml\u001b[0m\u001b[0m\n",
"\u001b[32;20m16:45:03\u001b[0m | \u001b[1m\u001b[38;20mINFO \u001b[0m\u001b[0m | \u001b[1m\u001b[38;20mActive profile: tutorial (https://tutorials.featurebyte.com/api/v1)\u001b[0m\u001b[0m\n",
"\u001b[32;20m16:45:03\u001b[0m | \u001b[1m\u001b[38;20mINFO \u001b[0m\u001b[0m | \u001b[1m\u001b[38;20mSDK version: 0.6.0.dev121\u001b[0m\u001b[0m\n",
"\u001b[32;20m16:45:03\u001b[0m | \u001b[1m\u001b[38;20mINFO \u001b[0m\u001b[0m | \u001b[1m\u001b[38;20mNo catalog activated.\u001b[0m\u001b[0m\n",
"\u001b[32;20m16:45:03\u001b[0m | \u001b[1m\u001b[38;20mINFO \u001b[0m\u001b[0m | \u001b[1m\u001b[38;20m10 feature lists, 59 features deployed\u001b[0m\u001b[0m\n",
"\u001b[32;20m16:45:03\u001b[0m | \u001b[1m\u001b[38;20mINFO \u001b[0m\u001b[0m | \u001b[1m\u001b[38;20mUsing profile: tutorial\u001b[0m\u001b[0m\n",
"\u001b[32;20m16:45:03\u001b[0m | \u001b[1m\u001b[38;20mINFO \u001b[0m\u001b[0m | \u001b[1m\u001b[38;20mUsing configuration file at: /Users/viktor/.featurebyte/config.yaml\u001b[0m\u001b[0m\n",
"\u001b[32;20m16:45:03\u001b[0m | \u001b[1m\u001b[38;20mINFO \u001b[0m\u001b[0m | \u001b[1m\u001b[38;20mActive profile: tutorial (https://tutorials.featurebyte.com/api/v1)\u001b[0m\u001b[0m\n",
"\u001b[32;20m16:45:04\u001b[0m | \u001b[1m\u001b[38;20mINFO \u001b[0m\u001b[0m | \u001b[1m\u001b[38;20mSDK version: 0.6.0.dev121\u001b[0m\u001b[0m\n",
"\u001b[32;20m16:45:04\u001b[0m | \u001b[1m\u001b[38;20mINFO \u001b[0m\u001b[0m | \u001b[1m\u001b[38;20mNo catalog activated.\u001b[0m\u001b[0m\n",
"\u001b[32;20m16:45:04\u001b[0m | \u001b[1m\u001b[38;20mINFO \u001b[0m\u001b[0m | \u001b[1m\u001b[38;20m10 feature lists, 59 features deployed\u001b[0m\u001b[0m\n",
"\u001b[32;20m16:45:04\u001b[0m | \u001b[1m\u001b[38;20mINFO \u001b[0m\u001b[0m | \u001b[1m\u001b[38;20mCatalog activated: Grocery Dataset Tutorial\u001b[0m\u001b[0m\n"
]
}
],
"source": [
"import featurebyte as fb\n",
"\n",
"# Set your profile to the tutorial environment\n",
"fb.use_profile(\"tutorial\")\n",
"\n",
"catalog_name = \"Grocery Dataset Tutorial\"\n",
"catalog = fb.Catalog.activate(catalog_name) "
]
},
{
"cell_type": "markdown",
"id": "cb3085ea",
"metadata": {},
"source": [
"#### List feature lists in Catalog"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "25d0339a",
"metadata": {
"tags": []
},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" id | \n",
" name | \n",
" num_feature | \n",
" status | \n",
" deployed | \n",
" readiness_frac | \n",
" online_frac | \n",
" tables | \n",
" entities | \n",
" primary_entity | \n",
" created_at | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 6564b959d3f7244b7fc926a0 | \n",
" Customer Simple FeatureList | \n",
" 7 | \n",
" DRAFT | \n",
" False | \n",
" 0.0 | \n",
" 0.0 | \n",
" [GROCERYCUSTOMER, GROCERYINVOICE, INVOICEITEMS... | \n",
" [customer] | \n",
" [customer] | \n",
" 2023-11-27T15:44:36.966000 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" id name num_feature status \\\n",
"0 6564b959d3f7244b7fc926a0 Customer Simple FeatureList 7 DRAFT \n",
"\n",
" deployed readiness_frac online_frac \\\n",
"0 False 0.0 0.0 \n",
"\n",
" tables entities \\\n",
"0 [GROCERYCUSTOMER, GROCERYINVOICE, INVOICEITEMS... [customer] \n",
"\n",
" primary_entity created_at \n",
"0 [customer] 2023-11-27T15:44:36.966000 "
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"catalog.list_feature_lists()"
]
},
{
"cell_type": "markdown",
"id": "abe93856",
"metadata": {},
"source": [
"#### Get Feature List from Catalog"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "96147a09",
"metadata": {
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Loading Feature(s) |████████████████████████████████████████| 7/7 [100%] in 0.7s\n"
]
}
],
"source": [
"simple_feature_list = catalog.get_feature_list(\"Customer Simple FeatureList\")"
]
},
{
"cell_type": "markdown",
"id": "282901eb",
"metadata": {},
"source": [
"#### Get an observation table"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "02737afa",
"metadata": {
"tags": []
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" id | \n",
" name | \n",
" type | \n",
" shape | \n",
" feature_store_name | \n",
" created_at | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 6564b8b466074d16d2f61078 | \n",
" Preview Table with 10 items | \n",
" view | \n",
" [10, 2] | \n",
" playground | \n",
" 2023-11-27T15:41:42.922000 | \n",
"
\n",
" \n",
" 1 | \n",
" 6564b8a56f39a417e1370dbd | \n",
" 1K Customers Spending next 2 weeks at time of ... | \n",
" observation_table | \n",
" [1000, 3] | \n",
" playground | \n",
" 2023-11-27T15:41:29.401000 | \n",
"
\n",
" \n",
" 2 | \n",
" 6564b89d66074d16d2f61075 | \n",
" 1K Customers at time of purchase 22S2-23S1 | \n",
" view | \n",
" [1000, 2] | \n",
" playground | \n",
" 2023-11-27T15:41:20.022000 | \n",
"
\n",
" \n",
" 3 | \n",
" 6564b89266074d16d2f61073 | \n",
" Preview Table with 10 Customers | \n",
" view | \n",
" [10, 2] | \n",
" playground | \n",
" 2023-11-27T15:41:10.029000 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" id \\\n",
"0 6564b8b466074d16d2f61078 \n",
"1 6564b8a56f39a417e1370dbd \n",
"2 6564b89d66074d16d2f61075 \n",
"3 6564b89266074d16d2f61073 \n",
"\n",
" name type \\\n",
"0 Preview Table with 10 items view \n",
"1 1K Customers Spending next 2 weeks at time of ... observation_table \n",
"2 1K Customers at time of purchase 22S2-23S1 view \n",
"3 Preview Table with 10 Customers view \n",
"\n",
" shape feature_store_name created_at \n",
"0 [10, 2] playground 2023-11-27T15:41:42.922000 \n",
"1 [1000, 3] playground 2023-11-27T15:41:29.401000 \n",
"2 [1000, 2] playground 2023-11-27T15:41:20.022000 \n",
"3 [10, 2] playground 2023-11-27T15:41:10.029000 "
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# List observation tables\n",
"catalog.list_observation_tables()"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "6cc65546",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"# Get observation table: '1K Customers Spending next 2 weeks at time of purchase 22S2-23S1'\n",
"training_observations = catalog.get_observation_table(\n",
" \"1K Customers Spending next 2 weeks at time of purchase 22S2-23S1\"\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "3680ba74",
"metadata": {
"tags": []
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" POINT_IN_TIME | \n",
" GROCERYCUSTOMERGUID | \n",
" CUSTOMER_Sum_of_invoice_Amount_next_14d | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 2022-12-22 18:43:31 | \n",
" 217d44e9-d85b-4dba-9847-2c4c071f7303 | \n",
" 0.00 | \n",
"
\n",
" \n",
" 1 | \n",
" 2023-06-10 15:09:47 | \n",
" 44d5a090-001a-4899-be0b-a74932ed42dc | \n",
" 141.42 | \n",
"
\n",
" \n",
" 2 | \n",
" 2022-11-29 17:08:01 | \n",
" f761a5d1-3b66-4faf-82f1-6cd59e2e28f8 | \n",
" 32.69 | \n",
"
\n",
" \n",
" 3 | \n",
" 2022-08-01 06:44:40 | \n",
" 1e866814-e5a6-475d-87e3-b53377cc005b | \n",
" 15.48 | \n",
"
\n",
" \n",
" 4 | \n",
" 2023-03-22 16:07:57 | \n",
" 44d5a090-001a-4899-be0b-a74932ed42dc | \n",
" 234.78 | \n",
"
\n",
" \n",
" 5 | \n",
" 2022-12-13 09:58:16 | \n",
" df0b0c04-f51b-48a5-b330-772cae5b9283 | \n",
" 34.79 | \n",
"
\n",
" \n",
" 6 | \n",
" 2022-07-22 15:13:54 | \n",
" f761a5d1-3b66-4faf-82f1-6cd59e2e28f8 | \n",
" 9.08 | \n",
"
\n",
" \n",
" 7 | \n",
" 2023-04-04 17:37:33 | \n",
" b5a96648-044f-4927-9877-a7d5a1956811 | \n",
" 46.65 | \n",
"
\n",
" \n",
" 8 | \n",
" 2022-08-02 16:59:08 | \n",
" a67434f3-f3d1-4c68-af80-fcd8fb7c9fc6 | \n",
" 0.00 | \n",
"
\n",
" \n",
" 9 | \n",
" 2022-11-07 16:58:07 | \n",
" 8f029048-c927-4861-809c-9eccec8e4743 | \n",
" 50.11 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" POINT_IN_TIME GROCERYCUSTOMERGUID \\\n",
"0 2022-12-22 18:43:31 217d44e9-d85b-4dba-9847-2c4c071f7303 \n",
"1 2023-06-10 15:09:47 44d5a090-001a-4899-be0b-a74932ed42dc \n",
"2 2022-11-29 17:08:01 f761a5d1-3b66-4faf-82f1-6cd59e2e28f8 \n",
"3 2022-08-01 06:44:40 1e866814-e5a6-475d-87e3-b53377cc005b \n",
"4 2023-03-22 16:07:57 44d5a090-001a-4899-be0b-a74932ed42dc \n",
"5 2022-12-13 09:58:16 df0b0c04-f51b-48a5-b330-772cae5b9283 \n",
"6 2022-07-22 15:13:54 f761a5d1-3b66-4faf-82f1-6cd59e2e28f8 \n",
"7 2023-04-04 17:37:33 b5a96648-044f-4927-9877-a7d5a1956811 \n",
"8 2022-08-02 16:59:08 a67434f3-f3d1-4c68-af80-fcd8fb7c9fc6 \n",
"9 2022-11-07 16:58:07 8f029048-c927-4861-809c-9eccec8e4743 \n",
"\n",
" CUSTOMER_Sum_of_invoice_Amount_next_14d \n",
"0 0.00 \n",
"1 141.42 \n",
"2 32.69 \n",
"3 15.48 \n",
"4 234.78 \n",
"5 34.79 \n",
"6 9.08 \n",
"7 46.65 \n",
"8 0.00 \n",
"9 50.11 "
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"training_observations.sample()"
]
},
{
"cell_type": "markdown",
"id": "d536db06",
"metadata": {},
"source": [
"#### Compute historical features"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "c070ac56",
"metadata": {
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Done! |████████████████████████████████████████| 100% in 35.7s (0.03%/s) \n"
]
}
],
"source": [
"# Create 'Simple Training data 1K Spending n2w 22S2-23S1' historical feature table\n",
"training_data_table = simple_feature_list.compute_historical_feature_table(\n",
" training_observations,\n",
" historical_feature_table_name=\"Simple Training data 1K Spending n2w 22S2-23S1\",\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "e616521d",
"metadata": {
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading table |████████████████████████████████████████| 1000/1000 [100%] in|█████████████████████████████▋ | ▂▂▄ 740/1000 [74%] \n"
]
},
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" POINT_IN_TIME | \n",
" GROCERYCUSTOMERGUID | \n",
" CUSTOMER_Sum_of_invoice_Amount_next_14d | \n",
" CUSTOMER_Age_band | \n",
" CUSTOMER_Latest_invoice_Amount | \n",
" CUSTOMER_Count_of_invoice_14d | \n",
" CUSTOMER_Avg_of_invoice_Amount_14d | \n",
" CUSTOMER_Std_of_invoice_Amount_14d | \n",
" CUSTOMER_Latest_invoice_Amount_Z_Score_to_invoice_Amount_28d | \n",
" CUSTOMER_vs_OVERALL_item_TotalCost_across_product_ProductGroups_26w | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 2022-08-02 10:50:09 | \n",
" 5f18f733-ef27-423b-8fb7-6172948c9255 | \n",
" 55.96 | \n",
" 75-79 | \n",
" 6.00 | \n",
" 2 | \n",
" 7.120 | \n",
" 1.120000 | \n",
" -0.425915 | \n",
" 0.819385 | \n",
"
\n",
" \n",
" 1 | \n",
" 2022-08-29 13:47:11 | \n",
" 2b068f1d-d99b-4c2f-a737-46f619a76cc8 | \n",
" 29.29 | \n",
" 50-54 | \n",
" 22.96 | \n",
" 5 | \n",
" 23.590 | \n",
" 11.680365 | \n",
" -0.206328 | \n",
" 0.672926 | \n",
"
\n",
" \n",
" 2 | \n",
" 2022-07-12 16:13:42 | \n",
" cc4220ec-16ab-4bb9-991d-deef994bf27a | \n",
" 115.54 | \n",
" 35-39 | \n",
" 11.86 | \n",
" 4 | \n",
" 22.830 | \n",
" 9.219916 | \n",
" -0.868016 | \n",
" 0.728931 | \n",
"
\n",
" \n",
" 3 | \n",
" 2022-07-28 14:39:56 | \n",
" 9540fe09-bf1c-41b4-847b-35f8a4a79927 | \n",
" 40.39 | \n",
" 30-34 | \n",
" 7.98 | \n",
" 6 | \n",
" 10.825 | \n",
" 4.767972 | \n",
" -0.630101 | \n",
" 0.811204 | \n",
"
\n",
" \n",
" 4 | \n",
" 2022-10-23 09:59:00 | \n",
" 62f833f8-029c-4446-bb85-b90a867d816e | \n",
" 88.74 | \n",
" 20-24 | \n",
" 1.00 | \n",
" 2 | \n",
" 1.695 | \n",
" 0.695000 | \n",
" -0.669011 | \n",
" 0.315181 | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" 995 | \n",
" 2022-12-09 03:42:52 | \n",
" 5845828c-6c2f-461f-b8cb-16ce5a4ffa73 | \n",
" 20.11 | \n",
" 25-29 | \n",
" 2.68 | \n",
" 0 | \n",
" NaN | \n",
" NaN | \n",
" -0.964306 | \n",
" 0.743137 | \n",
"
\n",
" \n",
" 996 | \n",
" 2023-03-07 19:19:20 | \n",
" dba29407-bc25-44ab-853c-3f7c1b78f296 | \n",
" 5.55 | \n",
" 50-54 | \n",
" 31.00 | \n",
" 0 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 0.485408 | \n",
"
\n",
" \n",
" 997 | \n",
" 2022-10-29 16:58:50 | \n",
" f2173f69-085f-4264-95c0-f46cbd5834aa | \n",
" 101.79 | \n",
" 35-39 | \n",
" 25.07 | \n",
" 0 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 0.457425 | \n",
"
\n",
" \n",
" 998 | \n",
" 2022-12-22 13:32:44 | \n",
" 7e4e042b-6c14-4ba1-a74d-ecb70664fb2f | \n",
" 0.00 | \n",
" 15-19 | \n",
" 5.18 | \n",
" 0 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 0.212817 | \n",
"
\n",
" \n",
" 999 | \n",
" 2022-11-16 19:24:33 | \n",
" 09f35825-38ef-4a01-8385-c41822f59de9 | \n",
" 41.78 | \n",
" 50-54 | \n",
" 28.54 | \n",
" 0 | \n",
" NaN | \n",
" NaN | \n",
" NaN | \n",
" 0.391692 | \n",
"
\n",
" \n",
"
\n",
"
1000 rows × 10 columns
\n",
"
"
],
"text/plain": [
" POINT_IN_TIME GROCERYCUSTOMERGUID \\\n",
"0 2022-08-02 10:50:09 5f18f733-ef27-423b-8fb7-6172948c9255 \n",
"1 2022-08-29 13:47:11 2b068f1d-d99b-4c2f-a737-46f619a76cc8 \n",
"2 2022-07-12 16:13:42 cc4220ec-16ab-4bb9-991d-deef994bf27a \n",
"3 2022-07-28 14:39:56 9540fe09-bf1c-41b4-847b-35f8a4a79927 \n",
"4 2022-10-23 09:59:00 62f833f8-029c-4446-bb85-b90a867d816e \n",
".. ... ... \n",
"995 2022-12-09 03:42:52 5845828c-6c2f-461f-b8cb-16ce5a4ffa73 \n",
"996 2023-03-07 19:19:20 dba29407-bc25-44ab-853c-3f7c1b78f296 \n",
"997 2022-10-29 16:58:50 f2173f69-085f-4264-95c0-f46cbd5834aa \n",
"998 2022-12-22 13:32:44 7e4e042b-6c14-4ba1-a74d-ecb70664fb2f \n",
"999 2022-11-16 19:24:33 09f35825-38ef-4a01-8385-c41822f59de9 \n",
"\n",
" CUSTOMER_Sum_of_invoice_Amount_next_14d CUSTOMER_Age_band \\\n",
"0 55.96 75-79 \n",
"1 29.29 50-54 \n",
"2 115.54 35-39 \n",
"3 40.39 30-34 \n",
"4 88.74 20-24 \n",
".. ... ... \n",
"995 20.11 25-29 \n",
"996 5.55 50-54 \n",
"997 101.79 35-39 \n",
"998 0.00 15-19 \n",
"999 41.78 50-54 \n",
"\n",
" CUSTOMER_Latest_invoice_Amount CUSTOMER_Count_of_invoice_14d \\\n",
"0 6.00 2 \n",
"1 22.96 5 \n",
"2 11.86 4 \n",
"3 7.98 6 \n",
"4 1.00 2 \n",
".. ... ... \n",
"995 2.68 0 \n",
"996 31.00 0 \n",
"997 25.07 0 \n",
"998 5.18 0 \n",
"999 28.54 0 \n",
"\n",
" CUSTOMER_Avg_of_invoice_Amount_14d CUSTOMER_Std_of_invoice_Amount_14d \\\n",
"0 7.120 1.120000 \n",
"1 23.590 11.680365 \n",
"2 22.830 9.219916 \n",
"3 10.825 4.767972 \n",
"4 1.695 0.695000 \n",
".. ... ... \n",
"995 NaN NaN \n",
"996 NaN NaN \n",
"997 NaN NaN \n",
"998 NaN NaN \n",
"999 NaN NaN \n",
"\n",
" CUSTOMER_Latest_invoice_Amount_Z_Score_to_invoice_Amount_28d \\\n",
"0 -0.425915 \n",
"1 -0.206328 \n",
"2 -0.868016 \n",
"3 -0.630101 \n",
"4 -0.669011 \n",
".. ... \n",
"995 -0.964306 \n",
"996 NaN \n",
"997 NaN \n",
"998 NaN \n",
"999 NaN \n",
"\n",
" CUSTOMER_vs_OVERALL_item_TotalCost_across_product_ProductGroups_26w \n",
"0 0.819385 \n",
"1 0.672926 \n",
"2 0.728931 \n",
"3 0.811204 \n",
"4 0.315181 \n",
".. ... \n",
"995 0.743137 \n",
"996 0.485408 \n",
"997 0.457425 \n",
"998 0.212817 \n",
"999 0.391692 \n",
"\n",
"[1000 rows x 10 columns]"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"display(training_data_table.to_pandas())"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "6a5faa69",
"metadata": {
"tags": []
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" id | \n",
" name | \n",
" feature_store_name | \n",
" observation_table_name | \n",
" shape | \n",
" created_at | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 6564b9896f39a417e1370e23 | \n",
" Simple Training data 1K Spending n2w 22S2-23S1 | \n",
" playground | \n",
" 1K Customers Spending next 2 weeks at time of ... | \n",
" [1000, 10] | \n",
" 2023-11-27T15:45:46.646000 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" id name \\\n",
"0 6564b9896f39a417e1370e23 Simple Training data 1K Spending n2w 22S2-23S1 \n",
"\n",
" feature_store_name observation_table_name \\\n",
"0 playground 1K Customers Spending next 2 weeks at time of ... \n",
"\n",
" shape created_at \n",
"0 [1000, 10] 2023-11-27T15:45:46.646000 "
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"### List historical feature tables from catalog\n",
"catalog.list_historical_feature_tables()"
]
},
{
"cell_type": "markdown",
"id": "a48de9bb",
"metadata": {},
"source": [
"### Concepts in this tutorial\n",
"- [More on Historical feature serving](https://docs.featurebyte.com/latest/about/glossary/#historical-feature-serving)\n",
"\n",
"#### SDK reference for\n",
"- [Historical feature table](https://docs.featurebyte.com/latest/reference/core/historical_feature_table/)\n",
"- [FeatureList.compute historical feature table()](https://docs.featurebyte.com/latest/reference/featurebyte.api.feature_list.FeatureList.compute_historical_feature_table/)\n",
"- [FeatureList.compute_historical_features()](https://docs.featurebyte.com/latest/reference/featurebyte.api.feature_list.FeatureList.compute_historical_features/) to compute directly a data frame"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "67d0c7c7",
"metadata": {
"tags": []
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" id | \n",
" name | \n",
" type | \n",
" status | \n",
" entities | \n",
" created_at | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 6564b7edbeba6c193e0fe3be | \n",
" GROCERYPRODUCT | \n",
" dimension_table | \n",
" PUBLIC_DRAFT | \n",
" [product, productgroup] | \n",
" 2023-11-27T15:38:22.276000 | \n",
"
\n",
" \n",
" 1 | \n",
" 6564b7ecbeba6c193e0fe3bd | \n",
" INVOICEITEMS | \n",
" item_table | \n",
" PUBLIC_DRAFT | \n",
" [item, invoice, product] | \n",
" 2023-11-27T15:38:21.489000 | \n",
"
\n",
" \n",
" 2 | \n",
" 6564b7ebbeba6c193e0fe3bc | \n",
" GROCERYINVOICE | \n",
" event_table | \n",
" PUBLIC_DRAFT | \n",
" [invoice, customer] | \n",
" 2023-11-27T15:38:20.150000 | \n",
"
\n",
" \n",
" 3 | \n",
" 6564b7eabeba6c193e0fe3bb | \n",
" GROCERYCUSTOMER | \n",
" scd_table | \n",
" PUBLIC_DRAFT | \n",
" [customer, frenchstate] | \n",
" 2023-11-27T15:38:19.300000 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" id name type status \\\n",
"0 6564b7edbeba6c193e0fe3be GROCERYPRODUCT dimension_table PUBLIC_DRAFT \n",
"1 6564b7ecbeba6c193e0fe3bd INVOICEITEMS item_table PUBLIC_DRAFT \n",
"2 6564b7ebbeba6c193e0fe3bc GROCERYINVOICE event_table PUBLIC_DRAFT \n",
"3 6564b7eabeba6c193e0fe3bb GROCERYCUSTOMER scd_table PUBLIC_DRAFT \n",
"\n",
" entities created_at \n",
"0 [product, productgroup] 2023-11-27T15:38:22.276000 \n",
"1 [item, invoice, product] 2023-11-27T15:38:21.489000 \n",
"2 [invoice, customer] 2023-11-27T15:38:20.150000 \n",
"3 [customer, frenchstate] 2023-11-27T15:38:19.300000 "
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"catalog.list_tables()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "39690066",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
}
},
"nbformat": 4,
"nbformat_minor": 5
}