From 9ebdb89332ba01f70b2acbf300c4ed664e11b246 Mon Sep 17 00:00:00 2001 From: HaoYizhi Date: Mon, 3 Jul 2023 12:40:10 +0800 Subject: [PATCH] experiments' --- .vscode/launch.json | 2 +- SQL_export_high_risk_setting.sql | 32 ++--- SQL_find_high_risk_setting.sql | 44 +++++++ __pycache__/controller_db.cpython-38.pyc | Bin 7881 -> 7881 bytes __pycache__/firm.cpython-38.pyc | Bin 8813 -> 8017 bytes __pycache__/model.cpython-38.pyc | Bin 13245 -> 12726 bytes controller_db.py | 14 +- oa_with_exp.xlsx | Bin 32071 -> 32071 bytes test.ipynb | 160 +++++++++++++++++++++++ 9 files changed, 221 insertions(+), 31 deletions(-) create mode 100644 SQL_find_high_risk_setting.sql diff --git a/.vscode/launch.json b/.vscode/launch.json index 80f4077..87ed9da 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -12,7 +12,7 @@ "console": "integratedTerminal", "justMyCode": true, "args": [ - "--exp", "without_exp", + "--exp", "with_exp", "--reset_db", "True", "--job", "24" ] diff --git a/SQL_export_high_risk_setting.sql b/SQL_export_high_risk_setting.sql index abf784a..cfa3a17 100644 --- a/SQL_export_high_risk_setting.sql +++ b/SQL_export_high_risk_setting.sql @@ -1,19 +1,15 @@ -select count(*) from iiabmdb.without_exp_sample; - -select distinct s_id from iiabmdb.without_exp_result where ts > 0; -select s_id, max(ts) as max_ts from iiabmdb.without_exp_result where ts > 0 group by s_id order by max_ts; -select e_id, count(id) as count, max(max_ts) as max_max_ts from iiabmdb.without_exp_sample as a -inner join (select s_id, max(ts) as max_ts from iiabmdb.without_exp_result where ts > 0 group by s_id) as b -on a.id = b.s_id +select e_id, n_disrupt_sample, total_n_disrupt_firm_prod_experiment, dct_lst_init_disrupt_firm_prod from iiabmdb.without_exp_experiment as experiment +inner join ( +select e_id, count(id) as n_disrupt_sample, sum(n_disrupt_firm_prod_sample) as total_n_disrupt_firm_prod_experiment from iiabmdb.without_exp_sample as sample +inner join ( +select * from +(select s_id, COUNT(DISTINCT id_firm, id_product) as n_disrupt_firm_prod_sample from iiabmdb.without_exp_result group by s_id +) as count_disrupt_firm_prod_sample +where n_disrupt_firm_prod_sample > 1 +) as disrupt_sample +on sample.id = disrupt_sample.s_id group by e_id -order by count desc; - -select e_id, count, max_max_ts, dct_lst_init_remove_firm_prod from iiabmdb.without_exp_experiment as a -inner join -(select e_id, count(id) as count, max(max_ts) as max_max_ts from iiabmdb.without_exp_sample as a -inner join (select s_id, max(ts) as max_ts from iiabmdb.without_exp_result where ts > 0 group by s_id) as b -on a.id = b.s_id -group by e_id) as b -on a.id = b.e_id -where count > 10 -order by count desc; +) as disrupt_experiment +on experiment.id = disrupt_experiment.e_id +order by n_disrupt_sample desc, total_n_disrupt_firm_prod_experiment desc +limit 0, 95; \ No newline at end of file diff --git a/SQL_find_high_risk_setting.sql b/SQL_find_high_risk_setting.sql new file mode 100644 index 0000000..21e7d21 --- /dev/null +++ b/SQL_find_high_risk_setting.sql @@ -0,0 +1,44 @@ +select max(ts_done) from iiabmdb.without_exp_sample; +select min(ts_done) from iiabmdb.without_exp_sample; +select count(*) from iiabmdb.without_exp_sample; + +select distinct s_id from iiabmdb.without_exp_result where ts > 0; +select s_id, max(ts) as max_ts from iiabmdb.without_exp_result where ts > 0 group by s_id order by max_ts; +select e_id, count(id) as count, max(max_ts) as max_max_ts from iiabmdb.without_exp_sample as a +inner join (select s_id, max(ts) as max_ts from iiabmdb.without_exp_result where ts > 0 group by s_id) as b +on a.id = b.s_id +group by e_id +order by count desc; + +select e_id, count, max_max_ts, dct_lst_init_remove_firm_prod from iiabmdb.without_exp_experiment as a +inner join +(select e_id, count(id) as count, max(max_ts) as max_max_ts from iiabmdb.without_exp_sample as a +inner join (select s_id, max(ts) as max_ts from iiabmdb.without_exp_result where ts > 0 group by s_id) as b +on a.id = b.s_id +group by e_id) as b +on a.id = b.e_id +where count > 10 +order by count desc; + +select s_id, max(ts) as max_ts from iiabmdb.without_exp_result where ts > 0 group by s_id; +select * from iiabmdb.without_exp_result order by s_id limit 0,50; +select s_id, COUNT(DISTINCT id_firm, id_product) as n_disrupt_firm_prod from iiabmdb.without_exp_result group by s_id; +select * from +(select s_id, COUNT(DISTINCT id_firm, id_product) as n_disrupt_firm_prod_sample from iiabmdb.without_exp_result group by s_id) as count_disrupt_firm_prod_sample +where n_disrupt_firm_prod_sample > 1; + +select e_id, n_disrupt_sample, total_n_disrupt_firm_prod_experiment, dct_lst_init_disrupt_firm_prod from iiabmdb.without_exp_experiment as experiment +inner join ( +select e_id, count(id) as n_disrupt_sample, sum(n_disrupt_firm_prod_sample) as total_n_disrupt_firm_prod_experiment from iiabmdb.without_exp_sample as sample +inner join ( +select * from +(select s_id, COUNT(DISTINCT id_firm, id_product) as n_disrupt_firm_prod_sample from iiabmdb.without_exp_result group by s_id +) as count_disrupt_firm_prod_sample +where n_disrupt_firm_prod_sample > 1 +) as disrupt_sample +on sample.id = disrupt_sample.s_id +group by e_id +) as disrupt_experiment +on experiment.id = disrupt_experiment.e_id +order by n_disrupt_sample desc, total_n_disrupt_firm_prod_experiment desc +limit 0, 95; # 20% of 475 experiment \ No newline at end of file diff --git a/__pycache__/controller_db.cpython-38.pyc b/__pycache__/controller_db.cpython-38.pyc index b4a7e5ab0e16aadad6978777f3a346f6cce2d2f7..a6891e5479fe9d447b66a00805b9c06e03f562de 100644 GIT binary patch delta 19 ZcmX?Ud(xIGl$V!_0SG3|*vPeC4gfYn1yTS2 delta 19 ZcmX?Ud(xIGl$V!_0SNw0-^jIJ4gfgC1-$?O diff --git a/__pycache__/firm.cpython-38.pyc b/__pycache__/firm.cpython-38.pyc index fa98168b1ee8f9391a3a87f0ea26b02b85e9295f..26921ffb8c6a6b450caaf00a2695eeba5731865b 100644 GIT binary patch delta 2262 zcmaJ?QEXFH7(V~Gx98s8uD9)4Hr4@SFv1FGKxIqDvH=+lCS#(EiG(5G9gI5|_H;yp zw`n3ID-Y`8c>+Y+#0NB}0pp|b1r3iHeL(bqXktuMqWHp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jv?GqfWgP+vN~suO-9zD^7KR2~-VAmt;$^Tu>=(PBweF%kkiDmz)`~ zRqos$nchr0(_jx;^f*-Qa==m{rcOP4Nu_$;RSjtCWe7YiQ?G@}n81ofu1OXWa6O6h z|DOc)K_^#gNj!O$BDAbp;s%guJ#kp&dQi%K&fT_$>r2@FGM{IjFfa3Q=L)ghtPUmW zgQiMMgZd#IHzX54H@2VaXah{^&U~K(Z_ROMb{A7#e}!859Tov!Bw7E=+j;QduoCRg zgVqh%4j@T03l1UcC(S)r$h`>r5dMdrb+DH6K5wK`Dl?&Fo^^Oz(Xxx_^!)7!;Fv=l zheWs0O_gloP~TwJU7W`ND(>v{#o5{Uc$IN!T+bk6MX7HD8rrY>dRw0H$}HiQlg>Nh z-+fz&0D?D#Fv%itD0>P7i8Lx+Qm?dtJEEYb_Q3g z1~r5(l$~G_XxBmS(zz??htczB3I60j(3-k)k<|<@4}v?lr8E2hAQ3S2qZ!w^n|dFp zmWRuBJ@+_Nd6=2V?1t1gRH+S;Q$OlM+vx_@Xg48?L2d?Yaimt%ieQ>s336!pU4&IifaS^v^2Yef4}lXcP#Ypcs!KP62jW^H0?gbUTVwa<$y zLr=YDVdZbY2J@UShTql-sC5h3M1CNCHN260DE>Hnm^=~TXisxROW#hehhY;|e`jnC~Z 0 group by s_id) as b "\ - "on a.id = b.s_id " \ - "group by e_id) as b " \ - "on a.id = b.e_id " \ - "order by count desc;" + with open('SQL_export_high_risk_setting.sql', 'r') as f: + str_sql = f.read() result = pd.read_sql(sql=str_sql, con=engine) result['dct_lst_init_disrupt_firm_prod'] = \ result['dct_lst_init_disrupt_firm_prod'].apply( diff --git a/oa_with_exp.xlsx b/oa_with_exp.xlsx index a880df4b940fad0a7379149e6f7f379eaad5466f..1d16ed289b1e7845207595790490fcd76eb41e3c 100644 GIT binary patch delta 5377 zcmai2c{r5+*Cu6O6ULf-P1ca5vW&H1CC^_#M6pZZL7fW$*7G$jo` z0x~JjdU(a-NN8(UndHGUnAd#&se?{z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dFUXaM7@ES?g*wD<W&G(2II-Gow=_4Y$rJB|2vq9%yMgHZ!#8-Uur>DCR!e6Q|9$s43#GeV zbN7g+EP^$)~IRchs8jQ6;n_ZS+B4=>I`@lE7A<_^`(+>740>)|#rP>ey|SGD6g%PH5g zv;JxPo1SwdJ}>Qa=Gj@Mrwm-b_!cNWsW!Rdd9%lO3^H;YHBPWd7#POuDI54G?$Yk| zG0Y;THQ#F)oKn+ApI+e#y7zK@fB##Xc-iB?NQQsz0J($zqSGb11Fq?tgv* zCyuT<-UsuX`R~8be@*~FCgkW4Yls~Ey691O0|@C9fl!B@`O?uFD)2^J>nJ>j148|y z&>aYmn;wNlI61m?;w0`0T{!V\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
e_idn_disrupt_sampletotal_n_disrupt_firm_prod_experimentdct_lst_init_disrupt_firm_prod
038350300.0b'\\x80\\x05\\x95\\x17\\x00\\x00\\x00\\x00\\x00\\x00\\x00...
122750250.0b'\\x80\\x05\\x95\\x16\\x00\\x00\\x00\\x00\\x00\\x00\\x00...
28350200.0b'\\x80\\x05\\x95\\x16\\x00\\x00\\x00\\x00\\x00\\x00\\x00...
313550200.0b'\\x80\\x05\\x95\\x16\\x00\\x00\\x00\\x00\\x00\\x00\\x00...
417950200.0b'\\x80\\x05\\x95\\x16\\x00\\x00\\x00\\x00\\x00\\x00\\x00...
...............
90762456.0b'\\x80\\x05\\x95\\x14\\x00\\x00\\x00\\x00\\x00\\x00\\x00...
91892454.0b'\\x80\\x05\\x95\\x16\\x00\\x00\\x00\\x00\\x00\\x00\\x00...
92902454.0b'\\x80\\x05\\x95\\x16\\x00\\x00\\x00\\x00\\x00\\x00\\x00...
933352454.0b'\\x80\\x05\\x95\\x17\\x00\\x00\\x00\\x00\\x00\\x00\\x00...
944492453.0b'\\x80\\x05\\x95\\x15\\x00\\x00\\x00\\x00\\x00\\x00\\x00...
\n", + "

95 rows × 4 columns

\n", + "" + ], + "text/plain": [ + " e_id n_disrupt_sample total_n_disrupt_firm_prod_experiment \\\n", + "0 383 50 300.0 \n", + "1 227 50 250.0 \n", + "2 83 50 200.0 \n", + "3 135 50 200.0 \n", + "4 179 50 200.0 \n", + ".. ... ... ... \n", + "90 76 24 56.0 \n", + "91 89 24 54.0 \n", + "92 90 24 54.0 \n", + "93 335 24 54.0 \n", + "94 449 24 53.0 \n", + "\n", + " dct_lst_init_disrupt_firm_prod \n", + "0 b'\\x80\\x05\\x95\\x17\\x00\\x00\\x00\\x00\\x00\\x00\\x00... \n", + "1 b'\\x80\\x05\\x95\\x16\\x00\\x00\\x00\\x00\\x00\\x00\\x00... \n", + "2 b'\\x80\\x05\\x95\\x16\\x00\\x00\\x00\\x00\\x00\\x00\\x00... \n", + "3 b'\\x80\\x05\\x95\\x16\\x00\\x00\\x00\\x00\\x00\\x00\\x00... \n", + "4 b'\\x80\\x05\\x95\\x16\\x00\\x00\\x00\\x00\\x00\\x00\\x00... \n", + ".. ... \n", + "90 b'\\x80\\x05\\x95\\x14\\x00\\x00\\x00\\x00\\x00\\x00\\x00... \n", + "91 b'\\x80\\x05\\x95\\x16\\x00\\x00\\x00\\x00\\x00\\x00\\x00... \n", + "92 b'\\x80\\x05\\x95\\x16\\x00\\x00\\x00\\x00\\x00\\x00\\x00... \n", + "93 b'\\x80\\x05\\x95\\x17\\x00\\x00\\x00\\x00\\x00\\x00\\x00... \n", + "94 b'\\x80\\x05\\x95\\x15\\x00\\x00\\x00\\x00\\x00\\x00\\x00... \n", + "\n", + "[95 rows x 4 columns]" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "with open('SQL_export_high_risk_setting.sql', 'r') as f:\n", + " contents = f.read()\n", + "\n", + "import pandas as pd\n", + "from orm import engine\n", + "result = pd.read_sql(sql=contents, con=engine)\n", + "result" + ] } ], "metadata": {