From 1078ae72a9cb4fde46399a0823bd3810d8faa8bd Mon Sep 17 00:00:00 2001 From: ryuta-yoshimatsu Date: Tue, 7 Jan 2025 06:50:10 +0000 Subject: [PATCH] updated-recommended-cluster-configuration --- 00_intro.ipynb | 96 +++++++++++++++++++++++ 01_causal_discovery.ipynb | 81 +++++++++++++++++-- 02_identification_estimation.ipynb | 103 ++++++++++++++++++++++++- 03_promotional_offer_recommender.ipynb | 97 +++++++++++++++++++++++ 04_refutation.ipynb | 87 +++++++++++++++++++++ requirements.txt | 4 + 6 files changed, 462 insertions(+), 6 deletions(-) create mode 100644 requirements.txt diff --git a/00_intro.ipynb b/00_intro.ipynb index 1ecaa31..ab2910d 100644 --- a/00_intro.ipynb +++ b/00_intro.ipynb @@ -11,6 +11,7 @@ "inputWidgets": {}, "nuid": "2bb220eb-b4b5-46d8-a9a0-6e6331a01d46", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -29,6 +30,7 @@ "inputWidgets": {}, "nuid": "92a25ef9-1b17-4f26-a615-ad66f051c1e1", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -73,6 +75,7 @@ "inputWidgets": {}, "nuid": "3d527009-ad2d-4239-a427-37eabe35a6d6", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -119,6 +122,70 @@ "This data has been simulated and the promotional offer influence \"ground truth\" is therefore known." ] }, + { + "cell_type": "markdown", + "metadata": { + "application/vnd.databricks.v1+cell": { + "cellMetadata": { + "byteLimit": 2048000, + "rowLimit": 10000 + }, + "inputWidgets": {}, + "nuid": "799e931d-8298-4023-bfee-1cc53e7b2746", + "showTitle": false, + "tableResultSettingsMap": {}, + "title": "" + } + }, + "source": [ + "## Cluster Configuration\n", + "We recommend using a cluster with the following or similar specifications to run this solution accelerator:\n", + "- Unity Catalog enabled cluster\n", + "- Databricks Runtime 15.4 LTS ML or above\n", + "- Single-node cluster: e.g. `m5d.2xlarge` on AWS or `Standard_D8ds_v5` on Azure Databricks" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "application/vnd.databricks.v1+cell": { + "cellMetadata": { + "byteLimit": 2048000, + "rowLimit": 10000 + }, + "inputWidgets": {}, + "nuid": "af48cf73-d7f3-46e7-8651-9402b6d4babb", + "showTitle": false, + "tableResultSettingsMap": {}, + "title": "" + } + }, + "source": [ + "## Install Dependencies" + ] + }, + { + "cell_type": "code", + "execution_count": 0, + "metadata": { + "application/vnd.databricks.v1+cell": { + "cellMetadata": { + "byteLimit": 2048000, + "rowLimit": 10000 + }, + "inputWidgets": {}, + "nuid": "15b2add3-3894-4bc1-99bb-8c0e2582ebda", + "showTitle": true, + "tableResultSettingsMap": {}, + "title": "Install requirements" + } + }, + "outputs": [], + "source": [ + "%pip install -r ./requirements.txt --quiet\n", + "dbutils.library.restartPython()" + ] + }, { "cell_type": "markdown", "metadata": { @@ -130,6 +197,7 @@ "inputWidgets": {}, "nuid": "500f91de-740e-4cc9-b63b-2f81a77a9899", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -153,7 +221,11 @@ "inputWidgets": {}, "nuid": "7074a071-e301-4043-9d1d-2a90ee4f95e5", "showTitle": true, + "tableResultSettingsMap": {}, "title": "Loading helper functions" + }, + "jupyter": { + "outputs_hidden": true } }, "outputs": [], @@ -173,6 +245,7 @@ "inputWidgets": {}, "nuid": "195ac730-282a-43a9-9e60-04f0ac322c19", "showTitle": true, + "tableResultSettingsMap": {}, "title": "Obtaining summary statistics of the dataset" } }, @@ -196,6 +269,7 @@ "inputWidgets": {}, "nuid": "4f30d5af-d4a0-4191-8d73-c7b4f52f15f6", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -237,6 +311,7 @@ "inputWidgets": {}, "nuid": "3f16324b-38db-4c66-8eda-32bf209db06b", "showTitle": true, + "tableResultSettingsMap": {}, "title": "Display a box plot of each promotional offer vs Revenue (1 = incentive was provided)" } }, @@ -259,6 +334,7 @@ "inputWidgets": {}, "nuid": "ad77ecd0-6ee3-4d25-8940-872490e6726a", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -280,6 +356,7 @@ "inputWidgets": {}, "nuid": "eea443a9-4080-44cc-96cc-161d579b970e", "showTitle": true, + "tableResultSettingsMap": {}, "title": "Checking correlations among the distributions of the numerical features" } }, @@ -299,6 +376,7 @@ "inputWidgets": {}, "nuid": "0ffc2283-43d0-4444-91a7-9108753aa370", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -320,6 +398,7 @@ "inputWidgets": {}, "nuid": "683c13aa-0615-4a7e-b131-aa6754fb48df", "showTitle": true, + "tableResultSettingsMap": {}, "title": "Displaying box plots for numerical features vs Revenue" } }, @@ -343,6 +422,7 @@ "inputWidgets": {}, "nuid": "8bef3897-24b1-48c2-b944-bf2054bcecf7", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -361,6 +441,7 @@ "inputWidgets": {}, "nuid": "40f7a244-6869-49ca-9d90-92c071fe2c1b", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -382,6 +463,7 @@ "inputWidgets": {}, "nuid": "68e88377-88ed-40a2-b435-e559d6d7af44", "showTitle": true, + "tableResultSettingsMap": {}, "title": "Displaying customer \"PC count\" vs \"Size\" vs Incentive provided " } }, @@ -403,6 +485,7 @@ "inputWidgets": {}, "nuid": "15f56bdb-4beb-4fe6-9a61-a495da7d5dc3", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -423,6 +506,7 @@ "inputWidgets": {}, "nuid": "32ad0039-f35e-4686-ad50-87dfaf65db1c", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -453,6 +537,7 @@ "inputWidgets": {}, "nuid": "6541a350-62cf-4f12-ae86-2a0bf0789829", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -471,6 +556,7 @@ "inputWidgets": {}, "nuid": "401f0dcc-4f88-4a51-a339-979af7c8cf1c", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -487,14 +573,24 @@ ], "metadata": { "application/vnd.databricks.v1+notebook": { + "computePreferences": null, "dashboards": [], "environmentMetadata": null, "language": "python", "notebookMetadata": { + "mostRecentlyExecutedCommandWithImplicitDF": { + "commandId": 1375557022084006, + "dataframes": [ + "_sqldf" + ] + }, "pythonIndentUnit": 2 }, "notebookName": "00_intro", "widgets": {} + }, + "language_info": { + "name": "python" } }, "nbformat": 4, diff --git a/01_causal_discovery.ipynb b/01_causal_discovery.ipynb index d26643c..1c0c954 100644 --- a/01_causal_discovery.ipynb +++ b/01_causal_discovery.ipynb @@ -11,6 +11,7 @@ "inputWidgets": {}, "nuid": "c0be0376-f008-4fb8-8ca5-cd67241d7ec5", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -18,6 +19,48 @@ "This solution accelerator notebook is available at https://github.com/databricks-industry-solutions/causal-incentive." ] }, + { + "cell_type": "markdown", + "metadata": { + "application/vnd.databricks.v1+cell": { + "cellMetadata": { + "byteLimit": 2048000, + "rowLimit": 10000 + }, + "inputWidgets": {}, + "nuid": "946b617e-bb55-4933-a769-c73cea2f4916", + "showTitle": false, + "tableResultSettingsMap": {}, + "title": "" + } + }, + "source": [ + "## Cluster Configuration\n", + "We recommend using a cluster with the following or similar specifications to run this solution accelerator:\n", + "- Unity Catalog enabled cluster\n", + "- Databricks Runtime 15.4 LTS ML or above\n", + "- Single-node cluster: e.g. `m5d.2xlarge` on AWS or `Standard_D8ds_v5` on Azure Databricks" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "application/vnd.databricks.v1+cell": { + "cellMetadata": { + "byteLimit": 2048000, + "rowLimit": 10000 + }, + "inputWidgets": {}, + "nuid": "aa9221e4-ab26-447e-9c21-20b3cb69db44", + "showTitle": false, + "tableResultSettingsMap": {}, + "title": "" + } + }, + "source": [ + "## Install Dependencies" + ] + }, { "cell_type": "code", "execution_count": 0, @@ -29,8 +72,12 @@ }, "inputWidgets": {}, "nuid": "60f2f5e1-6ae9-4eea-b39d-8275fdc66a76", - "showTitle": false, - "title": "" + "showTitle": true, + "tableResultSettingsMap": {}, + "title": "Install graphviz from nicer visualization" + }, + "jupyter": { + "outputs_hidden": true } }, "outputs": [], @@ -52,12 +99,13 @@ "inputWidgets": {}, "nuid": "61a0f224-8195-4c8c-82c5-c273e0d7ee9b", "showTitle": true, - "title": "Install a library for visualization" + "tableResultSettingsMap": {}, + "title": "Install requirements" } }, "outputs": [], "source": [ - "%pip install pygraphviz==1.10 --quiet\n", + "%pip install -r ./requirements.txt pygraphviz==1.10 --quiet\n", "dbutils.library.restartPython()" ] }, @@ -73,7 +121,11 @@ "inputWidgets": {}, "nuid": "d2f6fd8a-0cb6-44ef-9312-8d6d27403d5a", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" + }, + "jupyter": { + "outputs_hidden": true } }, "outputs": [], @@ -92,6 +144,7 @@ "inputWidgets": {}, "nuid": "8be398d8-971b-4f43-a35d-782ad8eb618e", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -113,6 +166,7 @@ "inputWidgets": {}, "nuid": "539c43b9-846f-498b-807e-dd0864091d6b", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -155,6 +209,7 @@ "inputWidgets": {}, "nuid": "5fb82a8b-4352-43fe-966a-60d7a7160458", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -178,6 +233,7 @@ "inputWidgets": {}, "nuid": "04e61f57-7fdf-4467-b6d8-fad10dcc3024", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -196,6 +252,7 @@ "inputWidgets": {}, "nuid": "3d04da71-222a-4869-91e6-13a713ac1d99", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -221,6 +278,7 @@ "inputWidgets": {}, "nuid": "bcfe02e4-3fae-426d-a738-73d5835920d0", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -252,6 +310,7 @@ "inputWidgets": {}, "nuid": "5991b566-77f8-440d-b5cd-23ec2fcde25c", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -274,6 +333,7 @@ "inputWidgets": {}, "nuid": "910811fe-3f44-4c5f-b779-d81e013a983a", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -303,6 +363,7 @@ "inputWidgets": {}, "nuid": "b05c4958-c7d6-45e8-bc6c-7868cea8fd3f", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -322,6 +383,7 @@ "inputWidgets": {}, "nuid": "662f9d42-276e-4c09-b27d-6504c0bb1ba3", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -352,6 +414,7 @@ "inputWidgets": {}, "nuid": "dbc21d42-1b38-446b-ac49-888c69a40829", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -371,6 +434,7 @@ "inputWidgets": {}, "nuid": "2795b8e8-75c0-41d8-b7b4-84a366cd6df7", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -406,6 +470,7 @@ "inputWidgets": {}, "nuid": "7fc7ea1a-21ff-483f-8b1c-05a312df0022", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -427,6 +492,7 @@ "inputWidgets": {}, "nuid": "7ef03eaa-5715-4bc7-967b-b9a52baae38d", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -470,6 +536,7 @@ "inputWidgets": {}, "nuid": "eb6f6fd0-d18c-4aa6-9e01-00e6760e74e6", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -486,12 +553,13 @@ ], "metadata": { "application/vnd.databricks.v1+notebook": { + "computePreferences": null, "dashboards": [], "environmentMetadata": null, "language": "python", "notebookMetadata": { "mostRecentlyExecutedCommandWithImplicitDF": { - "commandId": 2548317818328688, + "commandId": 1375557022083871, "dataframes": [ "_sqldf" ] @@ -500,6 +568,9 @@ }, "notebookName": "01_causal_discovery", "widgets": {} + }, + "language_info": { + "name": "python" } }, "nbformat": 4, diff --git a/02_identification_estimation.ipynb b/02_identification_estimation.ipynb index a4daeb0..11b8428 100644 --- a/02_identification_estimation.ipynb +++ b/02_identification_estimation.ipynb @@ -11,6 +11,7 @@ "inputWidgets": {}, "nuid": "f51698b9-84bb-44bf-bfc5-b8d97b68080a", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -18,6 +19,70 @@ "This solution accelerator notebook is also available at https://github.com/databricks-industry-solutions/causal-incentive." ] }, + { + "cell_type": "markdown", + "metadata": { + "application/vnd.databricks.v1+cell": { + "cellMetadata": { + "byteLimit": 2048000, + "rowLimit": 10000 + }, + "inputWidgets": {}, + "nuid": "89bb7ad9-8c8e-4101-baca-e38dc78bd1ad", + "showTitle": false, + "tableResultSettingsMap": {}, + "title": "" + } + }, + "source": [ + "## Cluster Configuration\n", + "We recommend using a cluster with the following or similar specifications to run this solution accelerator:\n", + "- Unity Catalog enabled cluster\n", + "- Databricks Runtime 15.4 LTS ML or above\n", + "- Single-node cluster: e.g. `m5d.2xlarge` on AWS or `Standard_D8ds_v5` on Azure Databricks" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "application/vnd.databricks.v1+cell": { + "cellMetadata": { + "byteLimit": 2048000, + "rowLimit": 10000 + }, + "inputWidgets": {}, + "nuid": "b1bd99ae-10cc-43ed-9f42-fd47f693767e", + "showTitle": false, + "tableResultSettingsMap": {}, + "title": "" + } + }, + "source": [ + "## Install Dependencies" + ] + }, + { + "cell_type": "code", + "execution_count": 0, + "metadata": { + "application/vnd.databricks.v1+cell": { + "cellMetadata": { + "byteLimit": 2048000, + "rowLimit": 10000 + }, + "inputWidgets": {}, + "nuid": "821a838b-1da6-4288-8ad0-76035e75b1b9", + "showTitle": true, + "tableResultSettingsMap": {}, + "title": "Install requirements" + } + }, + "outputs": [], + "source": [ + "%pip install -r ./requirements.txt --quiet\n", + "dbutils.library.restartPython()" + ] + }, { "cell_type": "code", "execution_count": 0, @@ -30,7 +95,11 @@ "inputWidgets": {}, "nuid": "19b7bbc9-c08a-4a2b-87ac-5069175bfcb6", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" + }, + "jupyter": { + "outputs_hidden": true } }, "outputs": [], @@ -49,6 +118,7 @@ "inputWidgets": {}, "nuid": "270d5fe1-fa4d-4774-b9d9-e003abae1ab1", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -67,6 +137,7 @@ "inputWidgets": {}, "nuid": "f0607752-b4d8-4ec8-93d8-ce0bd7a2ea59", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -88,6 +159,7 @@ "inputWidgets": {}, "nuid": "a5ba81e1-2a9d-4515-a41c-d0e147267a6d", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -107,6 +179,7 @@ "inputWidgets": {}, "nuid": "4f64fdf2-ea9e-4f3e-8310-7653dee1d10a", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -126,6 +199,7 @@ "inputWidgets": {}, "nuid": "06921b02-d3e2-455f-af01-a919dbaf18d6", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -159,6 +233,7 @@ "inputWidgets": {}, "nuid": "cdd8d10c-7102-42e0-9c7b-f6594eb52020", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -177,6 +252,7 @@ "inputWidgets": {}, "nuid": "2afe3068-7875-4b22-a724-0e0bfc5a4eda", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -198,6 +274,7 @@ "inputWidgets": {}, "nuid": "26e4e3f5-8c38-45b7-9a7b-cee6970447d9", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -247,6 +324,7 @@ "inputWidgets": {}, "nuid": "86a7b8e8-b634-44d2-b17f-a58973ae3595", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -267,6 +345,7 @@ "inputWidgets": {}, "nuid": "20ca3b6d-731d-4840-8c29-9e5126e62db3", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -291,6 +370,7 @@ "inputWidgets": {}, "nuid": "9a9b6c67-7a78-45e3-999d-c56bf4de97b8", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -312,6 +392,7 @@ "inputWidgets": {}, "nuid": "440e4943-d277-420b-a0a7-93417879be0c", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -337,6 +418,7 @@ "inputWidgets": {}, "nuid": "b464cd92-a05f-4e6e-a6e4-84944eba7b03", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -356,6 +438,7 @@ "inputWidgets": {}, "nuid": "923607d7-b98c-469e-836b-505502108f74", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -397,6 +480,7 @@ "inputWidgets": {}, "nuid": "95152568-5e08-4a38-b878-0c29746fc06b", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -416,6 +500,7 @@ "inputWidgets": {}, "nuid": "e681358f-ce1b-4a57-a00d-51826f184195", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -440,6 +525,7 @@ "inputWidgets": {}, "nuid": "edb0944a-5523-4308-803f-bcc8146c19ca", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -461,6 +547,7 @@ "inputWidgets": {}, "nuid": "fe3a2163-841b-4166-a119-2ce485d91538", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -490,6 +577,7 @@ "inputWidgets": {}, "nuid": "2c909cb2-2577-481e-badb-0683f987ca5d", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -533,6 +621,7 @@ "inputWidgets": {}, "nuid": "0f17cddd-3978-49fb-a13e-beaa397793d8", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -557,6 +646,7 @@ "inputWidgets": {}, "nuid": "5b52b2d6-7047-4544-bec4-d12ddccaa5d8", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -578,6 +668,7 @@ "inputWidgets": {}, "nuid": "8daac7f0-1286-45ce-aef5-3ea506e9ac42", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -606,6 +697,7 @@ "inputWidgets": {}, "nuid": "8226a19b-8575-49cc-ae9a-bad7e92cfed4", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -633,6 +725,7 @@ "inputWidgets": {}, "nuid": "9373cd46-22ca-4b83-8a46-c3df70768340", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -653,6 +746,7 @@ "inputWidgets": {}, "nuid": "495cfae7-1e55-499a-8013-0aa2378f40b2", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -674,6 +768,7 @@ "inputWidgets": {}, "nuid": "dbe3b251-ae2a-4253-bca3-9d31e9870593", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -710,6 +805,7 @@ "inputWidgets": {}, "nuid": "bf5ea988-f494-4a20-8572-b0e31fc3443e", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -732,6 +828,7 @@ "inputWidgets": {}, "nuid": "a5a469e8-a40e-4428-8884-dfd9c637c677", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -748,12 +845,13 @@ ], "metadata": { "application/vnd.databricks.v1+notebook": { + "computePreferences": null, "dashboards": [], "environmentMetadata": null, "language": "python", "notebookMetadata": { "mostRecentlyExecutedCommandWithImplicitDF": { - "commandId": 888983575931288, + "commandId": 1375557022084086, "dataframes": [ "_sqldf" ] @@ -762,6 +860,9 @@ }, "notebookName": "02_identification_estimation", "widgets": {} + }, + "language_info": { + "name": "python" } }, "nbformat": 4, diff --git a/03_promotional_offer_recommender.ipynb b/03_promotional_offer_recommender.ipynb index 13003df..c078319 100644 --- a/03_promotional_offer_recommender.ipynb +++ b/03_promotional_offer_recommender.ipynb @@ -11,6 +11,7 @@ "inputWidgets": {}, "nuid": "1963c485-808e-4e6b-96bd-c10c4033ae99", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -18,6 +19,70 @@ "This solution accelerator notebook is available at https://github.com/databricks-industry-solutions/causal-incentive." ] }, + { + "cell_type": "markdown", + "metadata": { + "application/vnd.databricks.v1+cell": { + "cellMetadata": { + "byteLimit": 2048000, + "rowLimit": 10000 + }, + "inputWidgets": {}, + "nuid": "024797c4-a68e-482f-bd95-6e4847fc992b", + "showTitle": false, + "tableResultSettingsMap": {}, + "title": "" + } + }, + "source": [ + "## Cluster Configuration\n", + "We recommend using a cluster with the following or similar specifications to run this solution accelerator:\n", + "- Unity Catalog enabled cluster\n", + "- Databricks Runtime 15.4 LTS ML or above\n", + "- Single-node cluster: e.g. `m5d.2xlarge` on AWS or `Standard_D8ds_v5` on Azure Databricks" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "application/vnd.databricks.v1+cell": { + "cellMetadata": { + "byteLimit": 2048000, + "rowLimit": 10000 + }, + "inputWidgets": {}, + "nuid": "6a6554be-f60d-427a-b044-7672ed13bc5a", + "showTitle": false, + "tableResultSettingsMap": {}, + "title": "" + } + }, + "source": [ + "## Install Dependencies" + ] + }, + { + "cell_type": "code", + "execution_count": 0, + "metadata": { + "application/vnd.databricks.v1+cell": { + "cellMetadata": { + "byteLimit": 2048000, + "rowLimit": 10000 + }, + "inputWidgets": {}, + "nuid": "12ff48a2-6fc0-40a5-a867-686630c7bf9c", + "showTitle": true, + "tableResultSettingsMap": {}, + "title": "Install requirements" + } + }, + "outputs": [], + "source": [ + "%pip install -r ./requirements.txt --quiet\n", + "dbutils.library.restartPython()" + ] + }, { "cell_type": "code", "execution_count": 0, @@ -30,7 +95,11 @@ "inputWidgets": {}, "nuid": "eb599ae6-4b84-4808-922b-458856a6fa1d", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" + }, + "jupyter": { + "outputs_hidden": true } }, "outputs": [], @@ -49,6 +118,7 @@ "inputWidgets": {}, "nuid": "3f9a1d4f-6247-4358-bf1a-f79d7f2e3e94", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -70,6 +140,7 @@ "inputWidgets": {}, "nuid": "a03e256a-67a4-4e6a-9367-003f6624e916", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -144,6 +215,7 @@ "inputWidgets": {}, "nuid": "182d5be1-f0fb-417f-bd9c-e8cb8c75440c", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -167,6 +239,7 @@ "inputWidgets": {}, "nuid": "e6204a2c-bc30-46da-9d5e-71adfbff6837", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -212,6 +285,7 @@ "inputWidgets": {}, "nuid": "47331bbd-1c8c-46fb-bbdf-2f3cef7adb21", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -240,6 +314,7 @@ "inputWidgets": {}, "nuid": "5d7d00c3-2d48-4e32-ac93-f0dae8ca3781", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -264,6 +339,7 @@ "inputWidgets": {}, "nuid": "3af4d7d2-07e7-4694-b507-0e6ed8d5910e", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -285,6 +361,7 @@ "inputWidgets": {}, "nuid": "566ab2e3-0d22-49ed-bec4-7bbf19cfa67e", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -305,6 +382,7 @@ "inputWidgets": {}, "nuid": "9bd15800-17bb-4805-8a3c-82e8da057d31", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -329,6 +407,7 @@ "inputWidgets": {}, "nuid": "430ed66f-df52-4b3c-97f2-b482236f2433", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -347,6 +426,7 @@ "inputWidgets": {}, "nuid": "6f5f2040-c2cf-4129-9b40-c26a30648ef9", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -366,6 +446,7 @@ "inputWidgets": {}, "nuid": "186e105c-e7e2-42b0-b528-9a624d7967c7", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -388,6 +469,7 @@ "inputWidgets": {}, "nuid": "a855e7b1-6cd4-4195-9be7-1effd6c7197a", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -409,6 +491,7 @@ "inputWidgets": {}, "nuid": "bdc04774-3b77-467b-99ec-0584e33bff8d", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -429,6 +512,7 @@ "inputWidgets": {}, "nuid": "b6d8268c-0a51-4e53-b0b1-45e5dcce9724", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -448,6 +532,7 @@ "inputWidgets": {}, "nuid": "42ae946e-b195-4b3b-8f4f-d8c284afb6f6", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -471,6 +556,7 @@ "inputWidgets": {}, "nuid": "e84f7dcb-5129-4df8-a62b-b8c2f7291678", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -489,6 +575,7 @@ "inputWidgets": {}, "nuid": "d83c00ca-2833-4b9e-bd3e-106c2813c533", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -505,14 +592,24 @@ ], "metadata": { "application/vnd.databricks.v1+notebook": { + "computePreferences": null, "dashboards": [], "environmentMetadata": null, "language": "python", "notebookMetadata": { + "mostRecentlyExecutedCommandWithImplicitDF": { + "commandId": 1375557022084102, + "dataframes": [ + "_sqldf" + ] + }, "pythonIndentUnit": 2 }, "notebookName": "03_promotional_offer_recommender", "widgets": {} + }, + "language_info": { + "name": "python" } }, "nbformat": 4, diff --git a/04_refutation.ipynb b/04_refutation.ipynb index ce15c0a..450e8c5 100644 --- a/04_refutation.ipynb +++ b/04_refutation.ipynb @@ -11,6 +11,7 @@ "inputWidgets": {}, "nuid": "08ea43f7-a118-44bf-9e8f-0a64ca254932", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -18,6 +19,70 @@ "This solution accelerator notebook is available at https://github.com/databricks-industry-solutions/causal-incentive." ] }, + { + "cell_type": "markdown", + "metadata": { + "application/vnd.databricks.v1+cell": { + "cellMetadata": { + "byteLimit": 2048000, + "rowLimit": 10000 + }, + "inputWidgets": {}, + "nuid": "eacc0cb1-0ce7-4ef5-883e-030a7caee311", + "showTitle": false, + "tableResultSettingsMap": {}, + "title": "" + } + }, + "source": [ + "## Cluster Configuration\n", + "We recommend using a cluster with the following or similar specifications to run this solution accelerator:\n", + "- Unity Catalog enabled cluster\n", + "- Databricks Runtime 15.4 LTS ML or above\n", + "- Single-node cluster: e.g. `m5d.2xlarge` on AWS or `Standard_D8ds_v5` on Azure Databricks" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "application/vnd.databricks.v1+cell": { + "cellMetadata": { + "byteLimit": 2048000, + "rowLimit": 10000 + }, + "inputWidgets": {}, + "nuid": "487df2bc-e819-4872-b6e9-948bb7244759", + "showTitle": false, + "tableResultSettingsMap": {}, + "title": "" + } + }, + "source": [ + "## Install Dependencies" + ] + }, + { + "cell_type": "code", + "execution_count": 0, + "metadata": { + "application/vnd.databricks.v1+cell": { + "cellMetadata": { + "byteLimit": 2048000, + "rowLimit": 10000 + }, + "inputWidgets": {}, + "nuid": "b94fbfea-f414-4057-9722-57504d7766ef", + "showTitle": true, + "tableResultSettingsMap": {}, + "title": "Install requirements" + } + }, + "outputs": [], + "source": [ + "%pip install -r ./requirements.txt --quiet\n", + "dbutils.library.restartPython()" + ] + }, { "cell_type": "code", "execution_count": 0, @@ -30,6 +95,7 @@ "inputWidgets": {}, "nuid": "5252e041-9be1-4fae-b0d2-d1ea362b1e74", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -49,6 +115,7 @@ "inputWidgets": {}, "nuid": "715d7031-369f-4b0c-a7d2-5a9d6db62340", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -67,6 +134,7 @@ "inputWidgets": {}, "nuid": "44a73459-20fa-468d-b0c6-8491949a976c", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -95,6 +163,7 @@ "inputWidgets": {}, "nuid": "4c90b52c-6de2-4625-92c4-b9742865b275", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -114,6 +183,7 @@ "inputWidgets": {}, "nuid": "f86ad090-bbe1-4d34-92bc-7487b746135d", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -137,6 +207,7 @@ "inputWidgets": {}, "nuid": "bd614eae-c2f1-4e20-aea3-d089e985fb0f", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -156,6 +227,7 @@ "inputWidgets": {}, "nuid": "ec92f977-642e-4f60-8ee1-4ed65ca61916", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -198,6 +270,7 @@ "inputWidgets": {}, "nuid": "fd8c2bb9-4725-46f4-95a6-944618c51585", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -219,6 +292,7 @@ "inputWidgets": {}, "nuid": "703c0184-37c6-4c1e-9321-9c2e6c9a200a", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -262,6 +336,7 @@ "inputWidgets": {}, "nuid": "e3a0d131-1e6e-486b-bc61-909fa138573f", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -281,6 +356,7 @@ "inputWidgets": {}, "nuid": "bf97f2c7-7a2d-4d9c-8655-e07b589411bb", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -321,6 +397,7 @@ "inputWidgets": {}, "nuid": "f786d7ca-774f-4d3f-84bd-ff6ad2b377c8", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -340,6 +417,7 @@ "inputWidgets": {}, "nuid": "59810965-5ed9-47f9-ad0a-d396984b6dea", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -380,6 +458,7 @@ "inputWidgets": {}, "nuid": "fd7bc428-3ce6-45b6-8342-05ee3cbfba28", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -399,6 +478,7 @@ "inputWidgets": {}, "nuid": "44ab4124-32ed-4938-876e-584c33358c9a", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -450,6 +530,7 @@ "inputWidgets": {}, "nuid": "eac0f339-0fbb-49db-b7f0-3d981d499596", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -471,6 +552,7 @@ "inputWidgets": {}, "nuid": "065c5f30-7bfb-4b30-b0b7-6e45ed7fe2df", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -499,6 +581,7 @@ "inputWidgets": {}, "nuid": "bea61eee-89be-465c-a2e2-2350902cbdde", "showTitle": false, + "tableResultSettingsMap": {}, "title": "" } }, @@ -515,6 +598,7 @@ ], "metadata": { "application/vnd.databricks.v1+notebook": { + "computePreferences": null, "dashboards": [], "environmentMetadata": null, "language": "python", @@ -523,6 +607,9 @@ }, "notebookName": "04_refutation", "widgets": {} + }, + "language_info": { + "name": "python" } }, "nbformat": 4, diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..de8bf4e --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +networkx==2.8.8 +causal-learn==0.1.3 +dowhy==0.10 +econml==0.14.0 \ No newline at end of file