Skip to content

Commit

Permalink
Add GCM online shop example notebook
Browse files Browse the repository at this point in the history
This is an updated and slightly modified version of the blog post: https://aws.amazon.com/blogs/opensource/root-cause-analysis-with-dowhy-an-open-source-python-library-for-causal-machine-learning/

Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
  • Loading branch information
bloebp committed Nov 17, 2023
1 parent 601c2ae commit 48742ff
Show file tree
Hide file tree
Showing 7 changed files with 1,175 additions and 4 deletions.
Binary file added docs/source/_static/online-shop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
366 changes: 366 additions & 0 deletions docs/source/example_notebooks/2021 Data.csv

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/source/example_notebooks/2022 First Day.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Date,Shopping Event?,Ad Spend,Page Views,Unit Price,Sold Units,Revenue,Operational Cost,Profit
2022-01-01,False,1392.3358280937282,10018,899.1,2756,2477919.6,1879401.202414113,598518.397585887
91 changes: 91 additions & 0 deletions docs/source/example_notebooks/2022 First Quarter.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
Date,Shopping Event?,Ad Spend,Page Views,Unit Price,Sold Units,Revenue,Operational Cost,Profit
2022-01-01,False,1392.3358280937282,10018,899.1,2756,2477919.6,1879401.202414113,598518.397585887
2022-01-02,False,1391.3913808337466,10038,899.1,2726,2450946.6,1864399.9104804778,586546.6895195222
2022-01-03,False,1293.990843338987,9941,899.1,2656,2388009.6,1829299.397053411,558710.2029465891
2022-01-04,False,1212.5903975212161,9950,899.1,2741,2464433.1,1871716.1029819865,592716.9970180136
2022-01-05,False,1182.4698371589263,9764,899.1,2697,2424872.7,1849701.0618950732,575171.638104927
2022-01-06,False,1467.445551067856,10207,899.1,2738,2461735.8000000003,1870468.5168295426,591267.2831704577
2022-01-07,True,2141.808717727631,17412,831.3573114052718,5643,4691349.308259949,3323643.689932692,1367705.6183272572
2022-01-08,False,1234.829256168011,10071,899.1,2723,2448249.3000000003,1862749.2170296635,585500.0829703368
2022-01-09,False,1376.020055104923,10129,899.1,2688,2416780.8000000003,1845378.2985341656,571402.5014658347
2022-01-10,False,1340.02761092149,9984,899.1,2794,2512085.4,1898350.3293293247,613735.0706706753
2022-01-11,False,1273.287440057397,9863,899.1,2696,2423973.6,1849280.0494022565,574693.5505977436
2022-01-12,False,1141.693146346015,9916,899.1,2759,2480616.9,1880646.1331021162,599970.7668978837
2022-01-13,False,1155.81122050363,10173,899.1,2831,2545352.1,1916660.5228116934,628691.5771883067
2022-01-14,False,1378.6091490867877,10145,899.1,2825,2539957.5,1913893.7435477874,626063.7564522126
2022-01-15,False,1293.478645787744,10082,899.1,2770,2490507.0,1886306.3993566553,604200.6006433447
2022-01-16,False,1235.8202923804415,10099,899.1,2860,2571426.0,1931237.6707989252,640188.3292010748
2022-01-17,False,1249.9174124330566,9907,899.1,2717,2442854.7,1859750.6417620734,583104.0582379268
2022-01-18,False,1271.47439232518,9888,899.1,2677,2406890.7,1839773.284036592,567117.4159634081
2022-01-19,False,1373.2226475584066,9764,899.1,2696,2423973.6,1849376.4607885955,574597.1392114046
2022-01-20,False,1340.3791158099252,10054,899.1,2768,2488708.8000000003,1885345.0795596098,603363.7204403905
2022-01-21,False,1128.1931917991249,9924,899.1,2764,2485112.4,1883130.7364539118,601981.6635460882
2022-01-22,False,1162.9911436309628,9648,899.1,2627,2361935.7,1814674.633357068,547261.0666429321
2022-01-23,False,1128.2222747689384,9842,899.1,2545,2288209.5,1773630.7895691658,514578.7104308342
2022-01-24,False,1113.8360503017068,9802,899.1,2649,2381715.9,1825615.6047651214,556100.2952348785
2022-01-25,False,1410.401967178016,10229,899.1,2770,2490507.0,1886417.1431889622,604089.8568110378
2022-01-26,False,1440.3835630651943,9978,899.1,2791,2509388.1,1896940.9275888735,612447.1724111266
2022-01-27,True,2988.4214329976066,17915,831.9998636067619,6240,5191679.148906195,3622996.5890260655,1568682.559880129
2022-01-28,False,1487.5363138089551,9990,899.1,2741,2464433.1,1871993.5629440963,592439.5370559038
2022-01-29,False,1445.4390808945325,9964,899.1,2696,2423973.6,1849447.010754491,574526.5892455091
2022-01-30,False,1444.1540175500318,10197,899.1,2770,2490507.0,1886446.0023766824,604060.9976233176
2022-01-31,False,1246.8737599731749,10033,899.1,2745,2468029.5,1873754.1199982178,594275.3800017822
2022-02-01,False,1481.7388652417399,10066,899.1,2730,2454543.0,1866503.6552066077,588039.3447933923
2022-02-02,False,1399.5719382535456,9997,899.1,2704,2431166.4,1853399.9672306762,577766.4327693237
2022-02-03,False,1241.4769716430899,10070,899.1,2704,2431166.4,1853247.3622717985,577919.0377282014
2022-02-04,False,1455.5331575779842,10091,899.1,2760,2481516.0,1881466.3955227518,600049.6044772482
2022-02-05,False,1101.6449199860515,9895,899.1,2717,2442854.7,1859602.5783715304,583252.1216284698
2022-02-06,False,1328.6364164935533,9962,899.1,2817,2532764.7,1909837.6106419214,622927.0893580788
2022-02-07,False,1308.069117200877,10016,899.1,2775,2495002.5,1888820.615166294,606181.8848337061
2022-02-08,False,1132.7159762121048,9861,899.1,2659,2390706.9,1830632.84014718,560074.0598528199
2022-02-09,False,1444.9425958010747,9861,899.1,2716,2441955.6,1859473.3602692473,582482.2397307528
2022-02-10,False,1212.684467045,9972,899.1,2750,2472525.0,1876230.156967209,596294.843032791
2022-02-11,False,1250.5400317812196,9750,899.1,2718,2443753.8000000003,1860258.2671390085,583495.5328609918
2022-02-12,False,1290.0613657717636,9946,899.1,2790,2508489.0,1896301.7101192577,612187.2898807423
2022-02-13,False,1426.7739321889594,10233,899.1,2829,2543553.9,1915938.2627990264,627615.6372009735
2022-02-14,False,1337.9752123091835,10053,899.1,2839,2552544.9,1920840.759277585,631704.140722415
2022-02-15,True,2351.475059441982,18894,790.8822013542945,6744,5333709.565933362,3874358.9633387243,1459350.6025946373
2022-02-16,False,1244.9510303702357,9871,899.1,2774,2494103.4,1888252.9386465398,605850.4613534601
2022-02-17,False,1211.8738687166879,9910,899.1,2711,2437460.1,1856714.7898701457,580745.3101298544
2022-02-18,False,1291.248092774871,9977,899.1,2701,2428469.1,1851817.548661015,576651.5513389851
2022-02-19,False,1202.2934128126344,10133,883.1651108098041,2780,2455199.0080512553,1891207.3343598437,563991.6736914115
2022-02-20,False,1235.804575281713,10084,899.1,2696,2423973.6,1849246.6954483406,574726.9045516595
2022-02-21,False,1276.1505339787307,10085,899.1,2656,2388009.6,1829286.22085432,558723.37914568
2022-02-22,False,1437.4003457574522,9904,899.1,2799,2516580.9,1900942.7903318,615638.1096681999
2022-02-23,False,1472.2042466986154,9964,899.1,2673,2403294.3000000003,1837976.7032677638,565317.5967322364
2022-02-24,False,1431.896547822394,10172,899.1,2743,2466231.3000000003,1872944.902847496,593286.3971525042
2022-02-25,False,1310.2798859572426,10076,899.1,2702,2429368.2,1852330.7801247423,577037.4198752579
2022-02-26,False,1384.62290131771,10043,899.1,2648,2380816.8000000003,1825387.4752716604,555429.3247283399
2022-02-27,False,1234.0834436842747,9702,899.1,2657,2388908.7,1829743.9021500424,559164.7978499578
2022-02-28,False,1283.678769021713,9910,899.1,2682,2411386.2,1842284.07082779,569102.1291722101
2022-03-01,False,1476.1958625388818,10020,899.1,2709,2435661.9,1855990.3574499364,579671.5425500635
2022-03-02,False,1241.9789919979662,9898,899.1,2682,2411386.2,1842256.0852074374,569130.1147925628
2022-03-03,False,1169.1942709029515,9892,899.1,2745,2468029.5,1873673.4418196054,594356.0581803946
2022-03-04,False,1288.837622807191,10030,899.1,2698,2425771.8000000003,1850296.6598978532,575475.1401021471
2022-03-05,False,1361.0366475166352,10010,899.1,2789,2507589.9,1895865.5077794136,611724.3922205863
2022-03-06,False,1150.6057039233983,10086,899.1,2773,2493204.3000000003,1887675.9748459037,605528.3251540966
2022-03-07,False,1148.8405674690443,9990,899.1,2773,2493204.3000000003,1887650.6458073962,605553.6541926041
2022-03-08,False,1221.47795637576,9850,899.1,2726,2450946.6,1864229.4841102757,586717.1158897243
2022-03-09,False,1463.0596405593335,10060,899.1,2781,2500397.1,1891973.8578367615,608423.2421632386
2022-03-10,False,1369.841540397185,10100,899.1,2678,2407789.8000000003,1840391.6702139727,567398.1297860276
2022-03-11,False,1188.773662552044,9895,899.1,2834,2548049.4,1918191.6567640717,629857.7432359282
2022-03-12,False,1341.3950242487674,9934,899.1,2660,2391606.0,1831345.182388721,560260.817611279
2022-03-13,False,1364.0959335247649,10107,899.1,2812,2528269.2,1907376.925745633,620892.2742543672
2022-03-14,False,1309.221871963138,10024,899.1,2726,2450946.6,1864309.6853946745,586636.9146053256
2022-03-15,False,1403.7529842149315,10026,899.1,2746,2468928.6,1874411.3054106305,594517.2945893696
2022-03-16,False,1109.8955954636629,10165,899.1,2802,2519278.2,1902111.2872151928,617166.9127848074
2022-03-17,False,1176.4468908415815,9992,899.1,2683,2412285.3000000003,1842689.52860202,569595.7713979804
2022-03-18,False,1486.5486977700477,10155,899.1,2747,2469827.7,1875005.0228379683,594822.6771620319
2022-03-19,False,1299.096000702733,9897,899.1,2750,2472525.0,1876301.3950001332,596223.6049998668
2022-03-20,True,2959.005898764264,18781,852.3176505002403,5582,4757637.125092342,3293965.8953605895,1463671.229731752
2022-03-21,False,1223.2718760871978,9911,899.1,2742,2465332.2,1872229.5640445976,593102.6359554026
2022-03-22,False,1100.7089544693627,9934,899.1,2697,2424872.7,1849605.1051355922,575267.594864408
2022-03-23,False,1331.7656967542457,9836,899.1,2683,2412285.3000000003,1842832.6021656336,569452.6978343667
2022-03-24,False,1499.7913000398273,10077,899.1,2754,2476121.4,1878519.0568463928,597602.3431536071
2022-03-25,False,1336.0397990084284,10141,899.1,2767,2487809.7,1884850.7572144207,602958.9427855795
2022-03-26,False,1344.0291715257779,9881,899.1,2807,2523773.7,1904848.162184592,618925.5378154081
2022-03-27,False,1231.0906450912316,9917,899.1,2755,2477020.5,1878736.1803134407,598284.3196865593
2022-03-28,False,1194.813018241124,10016,899.1,2799,2516580.9,1900707.1235184686,615873.7764815313
2022-03-29,False,1303.2626288160477,10058,899.1,2790,2508489.0,1896304.5482847781,612184.4517152219
2022-03-30,False,1459.914466790956,10093,899.1,2845,2557939.5,1923968.4508365616,633971.0491634384
2022-03-31,False,1103.9004416458804,9839,899.1,2756,2477919.6,1879111.1779584847,598808.4220415154
Loading

0 comments on commit 48742ff

Please sign in to comment.