diff --git a/notebooks/01-use-cases/finance/front-office/real-time-risk/content/content.mv.db b/notebooks/01-use-cases/finance/front-office/real-time-risk/content/content.mv.db index 9e48305b..57bda225 100644 Binary files a/notebooks/01-use-cases/finance/front-office/real-time-risk/content/content.mv.db and b/notebooks/01-use-cases/finance/front-office/real-time-risk/content/content.mv.db differ diff --git a/notebooks/01-use-cases/finance/front-office/real-time-risk/main.ipynb b/notebooks/01-use-cases/finance/front-office/real-time-risk/main.ipynb index 9be3509a..2d579072 100644 --- a/notebooks/01-use-cases/finance/front-office/real-time-risk/main.ipynb +++ b/notebooks/01-use-cases/finance/front-office/real-time-risk/main.ipynb @@ -138,8 +138,8 @@ "application/vnd.atoti.link.v0+json": { "path": "", "sessionLocation": { - "https": null, - "port": 56321 + "https": false, + "port": 56136 } }, "text/plain": [ @@ -384,15 +384,15 @@ "data": { "application/vnd.atoti.widget.v0+json": { "name": "Initial risk data", - "sessionId": "1664105993_7X77PT", + "sessionId": "1669704981_M8UKJB", "sessionLocation": { - "https": null, - "port": 56321 + "https": false, + "port": 56136 }, "widgetCreationCode": "session.visualize()" }, "text/html": [ - "" + "" ], "text/plain": [ "Open the notebook in JupyterLab with the atoti extension enabled to build this widget." @@ -490,6 +490,14 @@ "execution_count": 16, "metadata": {}, "output_type": "execute_result" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "New file received risk_data_previous_cob.csv\n", + "File loaded ./dynamic-input-files\\risk_data_previous_cob.csv\n" + ] } ], "source": [ @@ -539,15 +547,15 @@ "data": { "application/vnd.atoti.widget.v0+json": { "name": "Risk data after uploading 8th of July", - "sessionId": "1664105993_7X77PT", + "sessionId": "1669704981_M8UKJB", "sessionLocation": { - "https": null, - "port": 56321 + "https": false, + "port": 56136 }, "widgetCreationCode": "session.visualize()" }, "text/html": [ - "" + "" ], "text/plain": [ "Open the notebook in JupyterLab with the atoti extension enabled to build this widget." @@ -681,7 +689,16 @@ "cell_type": "code", "execution_count": 19, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "File modified risk_data_previous_cob.csv\n", + "Modified file loaded ./dynamic-input-files\\risk_data_previous_cob.csv\n" + ] + } + ], "source": [ "previous_cob_df.to_csv(\n", " \"./dynamic-input-files/risk_data_previous_cob.csv\",\n", @@ -731,15 +748,15 @@ "data": { "application/vnd.atoti.widget.v0+json": { "name": "Risk data after data file modification", - "sessionId": "1664105993_7X77PT", + "sessionId": "1669704981_M8UKJB", "sessionLocation": { - "https": null, - "port": 56321 + "https": false, + "port": 56136 }, "widgetCreationCode": "session.visualize()" }, "text/html": [ - "" + "" ], "text/plain": [ "Open the notebook in JupyterLab with the atoti extension enabled to build this widget." @@ -783,16 +800,7 @@ "cell_type": "code", "execution_count": 22, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "New file received risk_data_previous_cob.csv\n", - "File loaded ./dynamic-input-files\\risk_data_previous_cob.csv\n" - ] - } - ], + "outputs": [], "source": [ "market_data_table = session.read_csv(\n", " \"s3://data.atoti.io/notebooks/real-time-risk/static-input-files/market_data.csv\",\n", @@ -1138,13 +1146,16 @@ "data": { "application/vnd.atoti.widget.v0+json": { "name": "Quotes next to Deltas and MarketValues", - "sessionId": "1664105993_7X77PT", + "sessionId": "1669704981_M8UKJB", "sessionLocation": { - "https": null, - "port": 56321 + "https": false, + "port": 56136 }, "widgetCreationCode": "session.visualize()" }, + "text/html": [ + "" + ], "text/plain": [ "Open the notebook in JupyterLab with the atoti extension enabled to build this widget." ] @@ -1615,15 +1626,15 @@ "data": { "application/vnd.atoti.widget.v0+json": { "name": null, - "sessionId": "1664105993_7X77PT", + "sessionId": "1669704981_M8UKJB", "sessionLocation": { - "https": null, - "port": 56321 + "https": false, + "port": 56136 }, "widgetCreationCode": "session.visualize()" }, "text/html": [ - "" + "" ], "text/plain": [ "Open the notebook in JupyterLab with the atoti extension enabled to build this widget." @@ -1833,7 +1844,7 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 37, "metadata": {}, "outputs": [], "source": [ @@ -1845,7 +1856,7 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 38, "metadata": {}, "outputs": [], "source": [ @@ -1861,7 +1872,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 39, "metadata": {}, "outputs": [ { @@ -1869,15 +1880,15 @@ "application/vnd.atoti.link.v0+json": { "path": "#/dashboard/8b4", "sessionLocation": { - "https": null, - "port": 61379 + "https": false, + "port": 56136 } }, "text/plain": [ "Open the notebook in JupyterLab with the atoti extension enabled to see this link." ] }, - "execution_count": 38, + "execution_count": 39, "metadata": {}, "output_type": "execute_result" } @@ -1895,7 +1906,7 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 45, "metadata": {}, "outputs": [], "source": [ @@ -1973,7 +1984,7 @@ }, { "cell_type": "code", - "execution_count": 40, + "execution_count": 46, "metadata": { "tags": [] }, @@ -1982,7 +1993,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "(datetime.date(2020, 7, 9), 'OXY', 16.37)\n" + "(datetime.date(2020, 7, 9), 'AAPL', 394.22)\n" ] } ], @@ -1995,9 +2006,19 @@ }, { "cell_type": "code", - "execution_count": 41, + "execution_count": 47, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "File modified risk_data.csv\n", + "Modified file loaded ./dynamic-input-files\\risk_data.csv\n", + "awaiting for publishing update 2020-07-09 13:34:00" + ] + } + ], "source": [ "# pause publishing\n", "should_publish.clear()" @@ -2014,7 +2035,7 @@ }, { "cell_type": "code", - "execution_count": 42, + "execution_count": 48, "metadata": {}, "outputs": [], "source": [ @@ -2034,7 +2055,7 @@ "metadata": {}, "source": [ "```\n", - "docker exec -it real-time-risk_kafka_1 /opt/bitnami/kafka/bin/kafka-topics.sh --create --bootstrap-server 127.0.0.1:9092 --topic trades\n", + "docker exec -it real-time-risk-kafka-1 /opt/bitnami/kafka/bin/kafka-topics.sh --create --bootstrap-server 127.0.0.1:9092 --topic trades\n", "```\n", "\n", "The above real-time feeds are illustrating the file **watch** and the **append** command. Now let's have a quick look at enabling a **kafka feed** for a datastore.\n", @@ -2064,9 +2085,9 @@ "And then creating a topic for trades and sensitivites:\n", "\n", "```\n", - "docker exec -it real-time-risk_kafka_1 /opt/bitnami/kafka/bin/kafka-topics.sh --create --bootstrap-server 127.0.0.1:9092 --topic trades --partitions 3 --replication-factor 1\n", + "docker exec -it real-time-risk-kafka-1 /opt/bitnami/kafka/bin/kafka-topics.sh --create --bootstrap-server 127.0.0.1:9092 --topic trades --partitions 3 --replication-factor 1\n", "\n", - "docker exec -it real-time-risk_kafka_1 /opt/bitnami/kafka/bin/kafka-topics.sh --create --bootstrap-server 127.0.0.1:9092 --topic sensitivities --partitions 3 --replication-factor 1\n", + "docker exec -it real-time-risk-kafka-1 /opt/bitnami/kafka/bin/kafka-topics.sh --create --bootstrap-server 127.0.0.1:9092 --topic sensitivities --partitions 3 --replication-factor 1\n", "```" ] }, @@ -2079,7 +2100,7 @@ }, { "cell_type": "code", - "execution_count": 43, + "execution_count": 49, "metadata": {}, "outputs": [], "source": [ @@ -2097,7 +2118,7 @@ }, { "cell_type": "code", - "execution_count": 46, + "execution_count": 50, "metadata": {}, "outputs": [], "source": [ @@ -2112,7 +2133,7 @@ }, { "cell_type": "code", - "execution_count": 47, + "execution_count": 51, "metadata": {}, "outputs": [], "source": [ @@ -2134,7 +2155,7 @@ }, { "cell_type": "code", - "execution_count": 48, + "execution_count": 52, "metadata": {}, "outputs": [], "source": [ @@ -2146,7 +2167,7 @@ }, { "cell_type": "code", - "execution_count": 49, + "execution_count": 53, "metadata": { "tags": [] }, @@ -2170,7 +2191,7 @@ }, { "cell_type": "code", - "execution_count": 50, + "execution_count": 54, "metadata": {}, "outputs": [ { @@ -2178,15 +2199,15 @@ "application/vnd.atoti.link.v0+json": { "path": "#/dashboard/8b4", "sessionLocation": { - "https": null, - "port": 61379 + "https": false, + "port": 56136 } }, "text/plain": [ "Open the notebook in JupyterLab with the atoti extension enabled to see this link." ] }, - "execution_count": 50, + "execution_count": 54, "metadata": {}, "output_type": "execute_result" } @@ -2205,7 +2226,7 @@ }, { "cell_type": "code", - "execution_count": 51, + "execution_count": 55, "metadata": {}, "outputs": [ { @@ -2214,7 +2235,7 @@ "['AsOfDate', 'TradeId', 'RiskFactor', 'MarketValue', 'Delta']" ] }, - "execution_count": 51, + "execution_count": 55, "metadata": {}, "output_type": "execute_result" } @@ -2232,7 +2253,7 @@ }, { "cell_type": "code", - "execution_count": 52, + "execution_count": 56, "metadata": {}, "outputs": [], "source": [ @@ -2257,7 +2278,7 @@ }, { "cell_type": "code", - "execution_count": 53, + "execution_count": 57, "metadata": {}, "outputs": [ { @@ -2273,7 +2294,7 @@ " 'OptionType']" ] }, - "execution_count": 53, + "execution_count": 57, "metadata": {}, "output_type": "execute_result" } @@ -2291,7 +2312,7 @@ }, { "cell_type": "code", - "execution_count": 54, + "execution_count": 58, "metadata": { "tags": [] }, @@ -2334,7 +2355,7 @@ }, { "cell_type": "code", - "execution_count": 55, + "execution_count": 59, "metadata": {}, "outputs": [], "source": [ @@ -2384,7 +2405,7 @@ }, { "cell_type": "code", - "execution_count": 56, + "execution_count": 60, "metadata": {}, "outputs": [ { @@ -2392,15 +2413,15 @@ "application/vnd.atoti.link.v0+json": { "path": "#/dashboard/8b4", "sessionLocation": { - "https": null, - "port": 61379 + "https": false, + "port": 56136 } }, "text/plain": [ "Open the notebook in JupyterLab with the atoti extension enabled to see this link." ] }, - "execution_count": 56, + "execution_count": 60, "metadata": {}, "output_type": "execute_result" } @@ -2418,7 +2439,7 @@ }, { "cell_type": "code", - "execution_count": 57, + "execution_count": 64, "metadata": {}, "outputs": [ { @@ -2428,11 +2449,11 @@ "A new trade generated:\n", "{\n", " \"TradeId\": \"New_Trade_1\",\n", - " \"Ticker\": \"AAPL\",\n", - " \"Book\": \"EQ_LARG_DM\",\n", + " \"Ticker\": \"MSFT\",\n", + " \"Book\": \"EQ_SMAL_EM\",\n", " \"Product\": \"EQ_Option\",\n", - " \"Quantity\": 90,\n", - " \"Strike\": -52.88694789890223,\n", + " \"Quantity\": -63,\n", + " \"Strike\": -26.871216332703753,\n", " \"Maturity\": \"2022-10-01\",\n", " \"OptionType\": \"put\"\n", "}\n", @@ -2440,9 +2461,9 @@ "{\n", " \"AsOfDate\": \"2020-07-09\",\n", " \"TradeId\": \"New_Trade_1\",\n", - " \"RiskFactor\": \"AAPL\",\n", - " \"MarketValue\": 25.592967160657267,\n", - " \"Delta\": -4.726477195847423\n", + " \"RiskFactor\": \"MSFT\",\n", + " \"MarketValue\": 25.447715585254343,\n", + " \"Delta\": 53.37247432097948\n", "}\n", "Published.\n", "\n" diff --git a/notebooks/01-use-cases/finance/insurance/price-elasticity/main.ipynb b/notebooks/01-use-cases/finance/insurance/price-elasticity/main.ipynb index 8f0716fa..13f6ce57 100644 --- a/notebooks/01-use-cases/finance/insurance/price-elasticity/main.ipynb +++ b/notebooks/01-use-cases/finance/insurance/price-elasticity/main.ipynb @@ -671,7 +671,7 @@ "knn = KNeighborsClassifier(n_jobs=-1)\n", "nb = GaussianNB()\n", "svm = SVC()\n", - "xgbc = XGBClassifier(use_label_encoder=False)" + "xgbc = XGBClassifier()" ] }, { @@ -745,9 +745,9 @@ " \n", " 0\n", " (DecisionTreeClassifier(max_features='sqrt', r...\n", - " 0.930810\n", - " 0.867465\n", - " 0.951172\n", + " 0.931087\n", + " 0.869161\n", + " 0.950000\n", " \n", " \n", " 1\n", @@ -783,14 +783,14 @@ ], "text/plain": [ " model_name f1_score roc_auc_score \\\n", - "0 (DecisionTreeClassifier(max_features='sqrt', r... 0.930810 0.867465 \n", + "0 (DecisionTreeClassifier(max_features='sqrt', r... 0.931087 0.869161 \n", "1 KNeighborsClassifier(n_jobs=-1) 0.860897 0.731611 \n", "2 GaussianNB() 0.907729 0.853806 \n", "3 SVC() 0.893333 0.751059 \n", "4 XGBClassifier(base_score=0.5, booster='gbtree'... 0.936097 0.879652 \n", "\n", " recall \n", - "0 0.951172 \n", + "0 0.950000 \n", "1 0.895703 \n", "2 0.899219 \n", "3 0.968359 \n", @@ -838,16 +838,16 @@ "name": "stdout", "output_type": "stream", "text": [ - "['Price', 0.20924321]\n", - "['Driver_Age', 0.06532796]\n", - "['Employed', 0.061190005]\n", - "['Personal Auto', 0.056500446]\n", + "['Price', 0.2092432]\n", + "['Driver_Age', 0.065327965]\n", + "['Employed', 0.06118999]\n", + "['Personal Auto', 0.056500454]\n", "['Suburban', 0.04785541]\n", - "['Special Auto', 0.0455167]\n", - "['Premium', 0.036693245]\n", - "['Unemployed', 0.034293536]\n", - "['Basic', 0.033415023]\n", - "['Master', 0.032274764]\n" + "['Special Auto', 0.045516685]\n", + "['Premium', 0.03669324]\n", + "['Unemployed', 0.03429353]\n", + "['Basic', 0.033415027]\n", + "['Master', 0.032274768]\n" ] } ], @@ -902,10 +902,10 @@ " Method: Least Squares F-statistic: 1299. \n", "\n", "\n", - " Date: Mon, 08 Aug 2022 Prob (F-statistic): 0.00 \n", + " Date: Tue, 29 Nov 2022 Prob (F-statistic): 0.00 \n", "\n", "\n", - " Time: 17:28:44 Log-Likelihood: -7876.8 \n", + " Time: 15:22:22 Log-Likelihood: -7876.8 \n", "\n", "\n", " No. Observations: 33264 AIC: 1.582e+04\n", @@ -1068,8 +1068,8 @@ "Dep. Variable: Sale R-squared: 0.556\n", "Model: OLS Adj. R-squared: 0.555\n", "Method: Least Squares F-statistic: 1299.\n", - "Date: Mon, 08 Aug 2022 Prob (F-statistic): 0.00\n", - "Time: 17:28:44 Log-Likelihood: -7876.8\n", + "Date: Tue, 29 Nov 2022 Prob (F-statistic): 0.00\n", + "Time: 15:22:22 Log-Likelihood: -7876.8\n", "No. Observations: 33264 AIC: 1.582e+04\n", "Df Residuals: 33231 BIC: 1.610e+04\n", "Df Model: 32 \n", @@ -1335,92 +1335,48 @@ " \n", " \n", " \n", - " 3205793800425\n", - " 33.0\n", - " 7000.0\n", - " 660.26\n", + " 9976814432768\n", + " 35.0\n", " 9000.0\n", - " 247.08\n", - " 8.14\n", + " 707.79\n", + " 6000.0\n", + " 371.25\n", + " 6.63\n", " M\n", - " 66.03\n", - " Washington\n", - " 36860.7\n", - " Premium\n", - " College\n", - " Disabled\n", - " Rural\n", - " Call Center\n", - " 95\n", - " Corporate Auto\n", - " 1\n", - " 0.981653\n", - " \n", - " \n", - " 7168050486847\n", - " 23.0\n", - " 8000.0\n", - " 504.30\n", - " 8000.0\n", - " 319.14\n", - " 2.02\n", - " S\n", - " 25.21\n", - " Oregon\n", - " 2354.5\n", + " 70.78\n", + " Arizona\n", + " 7408.2\n", " Extended\n", " College\n", - " Unemployed\n", + " Retired\n", " Suburban\n", - " Call Center\n", - " 51\n", - " Special Auto\n", + " Agent\n", " 1\n", - " 0.855267\n", - " \n", - " \n", - " 1364086703071\n", - " 36.0\n", - " 10000.0\n", - " 613.51\n", - " 6000.0\n", - " 392.17\n", - " 9.75\n", - " M\n", - " 61.35\n", - " Nevada\n", - " 5386.5\n", - " Premium\n", - " High School or Below\n", - " Medical Leave\n", - " Rural\n", - " Branch\n", - " 99\n", - " Personal Auto\n", + " Special Auto\n", " 1\n", - " 0.977322\n", + " 0.999179\n", " \n", " \n", - " 7738460191121\n", - " 34.0\n", - " 9000.0\n", - " 729.53\n", + " 9845810226551\n", + " 51.0\n", + " 5000.0\n", + " 821.07\n", " 7000.0\n", - " 518.55\n", - " 8.63\n", - " M\n", - " 72.95\n", + " 450.49\n", + " 9.34\n", + " S\n", + " 82.11\n", " Oregon\n", - " 2378.7\n", - " Basic\n", - " Doctor\n", - " Medical Leave\n", - " Urban\n", - " Agent\n", - " 74\n", + " 2688.9\n", + " Extended\n", + " Master\n", + " Disabled\n", + " Suburban\n", + " Web\n", + " 75\n", " Personal Auto\n", " 1\n", - " 0.997727\n", + " 0.998984\n", " \n", " \n", " 2310686127723\n", @@ -1444,6 +1400,50 @@ " 0\n", " 0.252746\n", " \n", + " \n", + " 6203013183621\n", + " 25.0\n", + " 7000.0\n", + " 684.66\n", + " 7000.0\n", + " 534.85\n", + " 4.99\n", + " S\n", + " 34.23\n", + " Washington\n", + " 7661.4\n", + " Extended\n", + " Bachelor\n", + " Medical Leave\n", + " Rural\n", + " Web\n", + " 12\n", + " Corporate Auto\n", + " 1\n", + " 0.998522\n", + " \n", + " \n", + " 3861044483665\n", + " 36.0\n", + " 7000.0\n", + " 527.84\n", + " 9000.0\n", + " 338.83\n", + " 13.28\n", + " S\n", + " 26.39\n", + " California\n", + " 2274.8\n", + " Extended\n", + " High School or Below\n", + " Unemployed\n", + " Suburban\n", + " Call Center\n", + " 61\n", + " Special Auto\n", + " 1\n", + " 0.869075\n", + " \n", " \n", "\n", "" @@ -1451,51 +1451,51 @@ "text/plain": [ " Driver_Age Vehicle_Value Price Vehicle_Mileage \\\n", "cust_id \n", - "3205793800425 33.0 7000.0 660.26 9000.0 \n", - "7168050486847 23.0 8000.0 504.30 8000.0 \n", - "1364086703071 36.0 10000.0 613.51 6000.0 \n", - "7738460191121 34.0 9000.0 729.53 7000.0 \n", + "9976814432768 35.0 9000.0 707.79 6000.0 \n", + "9845810226551 51.0 5000.0 821.07 7000.0 \n", "2310686127723 37.0 7000.0 405.18 6000.0 \n", + "6203013183621 25.0 7000.0 684.66 7000.0 \n", + "3861044483665 36.0 7000.0 527.84 9000.0 \n", "\n", " Credit_Score Licence_Length_Years Marital_Status Tax \\\n", "cust_id \n", - "3205793800425 247.08 8.14 M 66.03 \n", - "7168050486847 319.14 2.02 S 25.21 \n", - "1364086703071 392.17 9.75 M 61.35 \n", - "7738460191121 518.55 8.63 M 72.95 \n", + "9976814432768 371.25 6.63 M 70.78 \n", + "9845810226551 450.49 9.34 S 82.11 \n", "2310686127723 397.26 8.20 S 20.26 \n", + "6203013183621 534.85 4.99 S 34.23 \n", + "3861044483665 338.83 13.28 S 26.39 \n", "\n", - " State CLTV Coverage_Type Education \\\n", - "cust_id \n", - "3205793800425 Washington 36860.7 Premium College \n", - "7168050486847 Oregon 2354.5 Extended College \n", - "1364086703071 Nevada 5386.5 Premium High School or Below \n", - "7738460191121 Oregon 2378.7 Basic Doctor \n", - "2310686127723 Nevada 6810.5 Extended Bachelor \n", + " State CLTV Coverage_Type Education \\\n", + "cust_id \n", + "9976814432768 Arizona 7408.2 Extended College \n", + "9845810226551 Oregon 2688.9 Extended Master \n", + "2310686127723 Nevada 6810.5 Extended Bachelor \n", + "6203013183621 Washington 7661.4 Extended Bachelor \n", + "3861044483665 California 2274.8 Extended High School or Below \n", "\n", " Employment_Status Location_Code Sales_Channel \\\n", "cust_id \n", - "3205793800425 Disabled Rural Call Center \n", - "7168050486847 Unemployed Suburban Call Center \n", - "1364086703071 Medical Leave Rural Branch \n", - "7738460191121 Medical Leave Urban Agent \n", + "9976814432768 Retired Suburban Agent \n", + "9845810226551 Disabled Suburban Web \n", "2310686127723 Employed Rural Web \n", + "6203013183621 Medical Leave Rural Web \n", + "3861044483665 Unemployed Suburban Call Center \n", "\n", " Months_Policy_Inception Policy_Type Sales_prediction \\\n", "cust_id \n", - "3205793800425 95 Corporate Auto 1 \n", - "7168050486847 51 Special Auto 1 \n", - "1364086703071 99 Personal Auto 1 \n", - "7738460191121 74 Personal Auto 1 \n", + "9976814432768 1 Special Auto 1 \n", + "9845810226551 75 Personal Auto 1 \n", "2310686127723 65 Special Auto 0 \n", + "6203013183621 12 Corporate Auto 1 \n", + "3861044483665 61 Special Auto 1 \n", "\n", " sales_prediction_probability \n", "cust_id \n", - "3205793800425 0.981653 \n", - "7168050486847 0.855267 \n", - "1364086703071 0.977322 \n", - "7738460191121 0.997727 \n", - "2310686127723 0.252746 " + "9976814432768 0.999179 \n", + "9845810226551 0.998984 \n", + "2310686127723 0.252746 \n", + "6203013183621 0.998522 \n", + "3861044483665 0.869075 " ] }, "execution_count": 22, @@ -1600,15 +1600,15 @@ "data": { "application/vnd.atoti.widget.v0+json": { "name": "Sales propotion by channel and coverage type", - "sessionId": "1659950924_Q5WXBP", + "sessionId": "1669706542_62K7HA", "sessionLocation": { - "https": null, - "port": 63222 + "https": false, + "port": 58178 }, "widgetCreationCode": "session.visualize()" }, "text/html": [ - "" + "" ], "text/plain": [ "Open the notebook in JupyterLab with the atoti extension enabled to build this widget." @@ -1658,15 +1658,15 @@ "data": { "application/vnd.atoti.widget.v0+json": { "name": "Revenue realized by State and location code", - "sessionId": "1659950924_Q5WXBP", + "sessionId": "1669706542_62K7HA", "sessionLocation": { - "https": null, - "port": 63222 + "https": false, + "port": 58178 }, "widgetCreationCode": "session.visualize()" }, "text/html": [ - "" + "" ], "text/plain": [ "Open the notebook in JupyterLab with the atoti extension enabled to build this widget." @@ -1717,15 +1717,15 @@ "data": { "application/vnd.atoti.widget.v0+json": { "name": "Sales by policy types", - "sessionId": "1659950924_Q5WXBP", + "sessionId": "1669706542_62K7HA", "sessionLocation": { - "https": null, - "port": 63222 + "https": false, + "port": 58178 }, "widgetCreationCode": "session.visualize()" }, "text/html": [ - "" + "" ], "text/plain": [ "Open the notebook in JupyterLab with the atoti extension enabled to build this widget." @@ -1780,15 +1780,15 @@ "data": { "application/vnd.atoti.widget.v0+json": { "name": "Revenue and sales by policy and coverage type", - "sessionId": "1659950924_Q5WXBP", + "sessionId": "1669706542_62K7HA", "sessionLocation": { - "https": null, - "port": 63222 + "https": false, + "port": 58178 }, "widgetCreationCode": "session.visualize()" }, "text/html": [ - "" + "" ], "text/plain": [ "Open the notebook in JupyterLab with the atoti extension enabled to build this widget." @@ -1837,15 +1837,15 @@ "data": { "application/vnd.atoti.widget.v0+json": { "name": "Revenue realised gauge", - "sessionId": "1659950924_Q5WXBP", + "sessionId": "1669706542_62K7HA", "sessionLocation": { - "https": null, - "port": 63222 + "https": false, + "port": 58178 }, "widgetCreationCode": "session.visualize()" }, "text/html": [ - "" + "" ], "text/plain": [ "Open the notebook in JupyterLab with the atoti extension enabled to build this widget." @@ -1880,8 +1880,8 @@ "application/vnd.atoti.link.v0+json": { "path": "#/dashboard/39f", "sessionLocation": { - "https": null, - "port": 63222 + "https": false, + "port": 58178 } }, "text/plain": [ @@ -2179,15 +2179,15 @@ "data": { "application/vnd.atoti.widget.v0+json": { "name": "Scenarios: Sales propotion by channel and coverage type", - "sessionId": "1659950924_Q5WXBP", + "sessionId": "1669706542_62K7HA", "sessionLocation": { - "https": null, - "port": 63222 + "https": false, + "port": 58178 }, "widgetCreationCode": "session.visualize()" }, "text/html": [ - "" + "" ], "text/plain": [ "Open the notebook in JupyterLab with the atoti extension enabled to build this widget." @@ -2243,15 +2243,15 @@ "data": { "application/vnd.atoti.widget.v0+json": { "name": "Scenarios: Revenue realised by State and location code", - "sessionId": "1659950924_Q5WXBP", + "sessionId": "1669706542_62K7HA", "sessionLocation": { - "https": null, - "port": 63222 + "https": false, + "port": 58178 }, "widgetCreationCode": "session.visualize()" }, "text/html": [ - "" + "" ], "text/plain": [ "Open the notebook in JupyterLab with the atoti extension enabled to build this widget." @@ -2306,15 +2306,15 @@ "data": { "application/vnd.atoti.widget.v0+json": { "name": "Scenarios: Revenue realized by policy types", - "sessionId": "1659950924_Q5WXBP", + "sessionId": "1669706542_62K7HA", "sessionLocation": { - "https": null, - "port": 63222 + "https": false, + "port": 58178 }, "widgetCreationCode": "session.visualize()" }, "text/html": [ - "" + "" ], "text/plain": [ "Open the notebook in JupyterLab with the atoti extension enabled to build this widget." @@ -2375,15 +2375,15 @@ "data": { "application/vnd.atoti.widget.v0+json": { "name": "Scenario: Revenue and sales by policy and coverage type", - "sessionId": "1659950924_Q5WXBP", + "sessionId": "1669706542_62K7HA", "sessionLocation": { - "https": null, - "port": 63222 + "https": false, + "port": 58178 }, "widgetCreationCode": "session.visualize()" }, "text/html": [ - "" + "" ], "text/plain": [ "Open the notebook in JupyterLab with the atoti extension enabled to build this widget." @@ -2434,15 +2434,15 @@ "data": { "application/vnd.atoti.widget.v0+json": { "name": "Scenarios: Revenue realised gauge", - "sessionId": "1659950924_Q5WXBP", + "sessionId": "1669706542_62K7HA", "sessionLocation": { - "https": null, - "port": 63222 + "https": false, + "port": 58178 }, "widgetCreationCode": "session.visualize()" }, "text/html": [ - "" + "" ], "text/plain": [ "Open the notebook in JupyterLab with the atoti extension enabled to build this widget." @@ -2475,8 +2475,8 @@ "application/vnd.atoti.link.v0+json": { "path": "#/dashboard/39f", "sessionLocation": { - "https": null, - "port": 63222 + "https": false, + "port": 58178 } }, "text/plain": [ @@ -2525,7 +2525,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.12" + "version": "3.9.13" } }, "nbformat": 4, diff --git a/notebooks/01-use-cases/finance/risk-management/credit-risk/ifrs9/main.ipynb b/notebooks/01-use-cases/finance/risk-management/credit-risk/ifrs9/main.ipynb index 4af29b42..ff64f887 100644 --- a/notebooks/01-use-cases/finance/risk-management/credit-risk/ifrs9/main.ipynb +++ b/notebooks/01-use-cases/finance/risk-management/credit-risk/ifrs9/main.ipynb @@ -64,7 +64,7 @@ "path": "", "sessionLocation": { "https": false, - "port": 49765 + "port": 59743 } }, "text/plain": [ @@ -233,52 +233,51 @@ " \n", " \n", " \n", - " 83979\n", - " 2007-09-01\n", + " 83979\n", + " 2007-10-01\n", + " 0.009044\n", + " 0.010853\n", + " 3296.043221\n", + " 0.7\n", + " 1\n", " 0.010798\n", " 0.012958\n", " 3218.853834\n", " 0.7\n", " 1\n", - " 0.010321\n", - " 0.012385\n", - " 3115.824071\n", - " 0.7\n", - " 1\n", " NaN\n", - " 3\n", + " 4\n", " \n", " \n", - " 121673\n", - " 2008-01-01\n", - " 0.023435\n", - " 0.028122\n", - " 4900.635234\n", - " 0.6\n", + " 2007-06-01\n", + " 0.011905\n", + " 0.014286\n", + " 3000.000000\n", + " 0.8\n", " 1\n", - " 0.024489\n", - " 0.029386\n", - " 5214.762451\n", - " 0.6\n", + " 0.011905\n", + " 0.014286\n", + " 3000.000000\n", + " 0.8\n", " 1\n", " NaN\n", - " 5\n", + " 0\n", " \n", " \n", - " 118533\n", - " 2007-09-01\n", - " 0.056348\n", - " 0.067618\n", - " 2582.666544\n", - " 0.7\n", + " 155218\n", + " 2008-02-01\n", + " 0.126738\n", + " 0.152086\n", + " 9806.929770\n", + " 0.6\n", " 2\n", - " 0.063748\n", - " 0.076497\n", - " 2500.000000\n", - " 0.8\n", + " 0.150825\n", + " 0.180990\n", + " 9892.029445\n", + " 0.6\n", " 2\n", " NaN\n", - " 1\n", + " 3\n", " \n", " \n", "\n", @@ -287,27 +286,27 @@ "text/plain": [ " PD12 PDLT EAD LGD Stage \\\n", "id Reporting Date \n", - "83979 2007-09-01 0.010798 0.012958 3218.853834 0.7 1 \n", - "121673 2008-01-01 0.023435 0.028122 4900.635234 0.6 1 \n", - "118533 2007-09-01 0.056348 0.067618 2582.666544 0.7 2 \n", + "83979 2007-10-01 0.009044 0.010853 3296.043221 0.7 1 \n", + " 2007-06-01 0.011905 0.014286 3000.000000 0.8 1 \n", + "155218 2008-02-01 0.126738 0.152086 9806.929770 0.6 2 \n", "\n", " Previous PD12 Previous PDLT Previous EAD \\\n", "id Reporting Date \n", - "83979 2007-09-01 0.010321 0.012385 3115.824071 \n", - "121673 2008-01-01 0.024489 0.029386 5214.762451 \n", - "118533 2007-09-01 0.063748 0.076497 2500.000000 \n", + "83979 2007-10-01 0.010798 0.012958 3218.853834 \n", + " 2007-06-01 0.011905 0.014286 3000.000000 \n", + "155218 2008-02-01 0.150825 0.180990 9892.029445 \n", "\n", " Previous LGD Previous Stage DaysPastDue \\\n", "id Reporting Date \n", - "83979 2007-09-01 0.7 1 NaN \n", - "121673 2008-01-01 0.6 1 NaN \n", - "118533 2007-09-01 0.8 2 NaN \n", + "83979 2007-10-01 0.7 1 NaN \n", + " 2007-06-01 0.8 1 NaN \n", + "155218 2008-02-01 0.6 2 NaN \n", "\n", " Months Since Inception \n", "id Reporting Date \n", - "83979 2007-09-01 3 \n", - "121673 2008-01-01 5 \n", - "118533 2007-09-01 1 " + "83979 2007-10-01 4 \n", + " 2007-06-01 0 \n", + "155218 2008-02-01 3 " ] }, "execution_count": 7, @@ -476,52 +475,52 @@ " 2018-07-01\n", " \n", " \n", - " 54057516\n", - " 57598247\n", - " 15000.0\n", - " 15000.0\n", - " 15000.0\n", - " 36 months\n", - " 12.69\n", - " 503.18\n", - " C\n", - " C2\n", - " Human resources specialist\n", + " 8295031\n", + " 10037157\n", + " 12000.0\n", + " 12000.0\n", + " 12000.0\n", + " 60 months\n", + " 10.99\n", + " 260.85\n", + " B\n", + " B2\n", + " Case manager\n", " ...\n", " NaN\n", " NaN\n", - " 22700.0\n", + " 74900.0\n", " NaN\n", " NaN\n", " NaN\n", - " 2015\n", - " 7\n", + " 2013\n", + " 10\n", " 1\n", - " 2018-07-01\n", - " \n", - " \n", - " 47592325\n", - " 50811048\n", - " 34750.0\n", - " 34750.0\n", - " 34750.0\n", - " 36 months\n", - " 19.52\n", - " 1282.96\n", - " E\n", - " E3\n", - " Accounts Director\n", + " 2018-10-01\n", + " \n", + " \n", + " 55253847\n", + " 58834764\n", + " 10400.0\n", + " 10400.0\n", + " 10400.0\n", + " 60 months\n", + " 21.99\n", + " 287.18\n", + " F\n", + " F1\n", + " License Mortgage Loan officer\n", " ...\n", " NaN\n", " NaN\n", - " 76100.0\n", + " 37000.0\n", " NaN\n", " NaN\n", " NaN\n", " 2015\n", - " 5\n", + " 7\n", " 1\n", - " 2018-05-01\n", + " 2020-07-01\n", " \n", " \n", "\n", @@ -532,26 +531,32 @@ " member_id loan_amnt funded_amnt funded_amnt_inv term \\\n", "id \n", "55959171 59620924 14000.0 14000.0 14000.0 36 months \n", - "54057516 57598247 15000.0 15000.0 15000.0 36 months \n", - "47592325 50811048 34750.0 34750.0 34750.0 36 months \n", + "8295031 10037157 12000.0 12000.0 12000.0 60 months \n", + "55253847 58834764 10400.0 10400.0 10400.0 60 months \n", + "\n", + " int_rate installment grade sub_grade \\\n", + "id \n", + "55959171 12.69 469.63 C C2 \n", + "8295031 10.99 260.85 B B2 \n", + "55253847 21.99 287.18 F F1 \n", "\n", - " int_rate installment grade sub_grade emp_title \\\n", - "id \n", - "55959171 12.69 469.63 C C2 Truck Driver \n", - "54057516 12.69 503.18 C C2 Human resources specialist \n", - "47592325 19.52 1282.96 E E3 Accounts Director \n", + " emp_title ... max_bal_bc all_util \\\n", + "id ... \n", + "55959171 Truck Driver ... NaN NaN \n", + "8295031 Case manager ... NaN NaN \n", + "55253847 License Mortgage Loan officer ... NaN NaN \n", "\n", - " ... max_bal_bc all_util total_rev_hi_lim inq_fi total_cu_tl \\\n", - "id ... \n", - "55959171 ... NaN NaN 8400.0 NaN NaN \n", - "54057516 ... NaN NaN 22700.0 NaN NaN \n", - "47592325 ... NaN NaN 76100.0 NaN NaN \n", + " total_rev_hi_lim inq_fi total_cu_tl inq_last_12m Opening Year \\\n", + "id \n", + "55959171 8400.0 NaN NaN NaN 2015 \n", + "8295031 74900.0 NaN NaN NaN 2013 \n", + "55253847 37000.0 NaN NaN NaN 2015 \n", "\n", - " inq_last_12m Opening Year Opening Month Opening Day maturity_date \n", - "id \n", - "55959171 NaN 2015 7 1 2018-07-01 \n", - "54057516 NaN 2015 7 1 2018-07-01 \n", - "47592325 NaN 2015 5 1 2018-05-01 \n", + " Opening Month Opening Day maturity_date \n", + "id \n", + "55959171 7 1 2018-07-01 \n", + "8295031 10 1 2018-10-01 \n", + "55253847 7 1 2020-07-01 \n", "\n", "[3 rows x 77 columns]" ] @@ -638,33 +643,33 @@ " \n", " \n", " \n", - " 16491451\n", + " 445007\n", " N/A\n", - " 0.057929\n", - " 0.069515\n", + " 0.078235\n", + " 0.093882\n", " \n", " \n", - " 32058330\n", + " 28743305\n", " N/A\n", - " 0.083669\n", - " 0.100402\n", + " 0.135286\n", + " 0.162343\n", " \n", " \n", - " 5036924\n", - " 2014-11-12 00:00:00\n", - " 0.029353\n", - " 0.035223\n", + " 63661236\n", + " N/A\n", + " 0.074856\n", + " 0.089827\n", " \n", " \n", "\n", "" ], "text/plain": [ - " default_date Opening PD12 Opening PDLT\n", - "id \n", - "16491451 N/A 0.057929 0.069515\n", - "32058330 N/A 0.083669 0.100402\n", - "5036924 2014-11-12 00:00:00 0.029353 0.035223" + " default_date Opening PD12 Opening PDLT\n", + "id \n", + "445007 N/A 0.078235 0.093882\n", + "28743305 N/A 0.135286 0.162343\n", + "63661236 N/A 0.074856 0.089827" ] }, "execution_count": 10, @@ -1419,11 +1424,6 @@ "outputs": [ { "data": { - "application/vnd.atoti.convert-query-result-to-widget.v0+json": { - "mdx": "SELECT {[Measures].[EAD], [Measures].[Previous EAD], [Measures].[EAD (Chg)], [Measures].[EAD (Chg %)]} ON COLUMNS, NON EMPTY [Credit Risk].[Reporting Date].[Reporting Date].Members ON ROWS FROM [IFRS9]", - "sessionId": "1666698770_DY3ITH", - "widgetCreationCode": "session.visualize()" - }, "text/html": [ "
\n", "