-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
26 lines (22 loc) · 986 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import pandas as pd
import dataexpl
import dataprep
import models
import resexpl
def main():
dataprep.dataprep("edit", edit_col="Global terrorism")
dataexpl.dataexpl()
for extra in [[], ["interpol_glob_GTD"], ["education"], ["interpol_glob_GTD", "education"]]:
auc_roc_log = pd.DataFrame()
auc_pr_log = pd.DataFrame()
for var in ["academic", "professional", "combined", "all", "notrade", "nogdp"]:
models.new_models(varchoice=var, roclog=auc_roc_log, prlog=auc_pr_log, extra_options=extra, write=True)
suffix = '_' + "+".join(extra) if extra else ''
auc_roc_log.to_csv("output_files/auc_roc_per_model" + suffix + ".csv")
auc_pr_log.to_csv("output_files/auc_pr_per_model" + suffix + ".csv")
auc_roc_log = pd.DataFrame()
auc_pr_log = pd.DataFrame()
models.new_models(varchoice="nogdpweap", roclog=auc_roc_log, prlog=auc_pr_log, write=True)
resexpl.resexpl()
if __name__ == "__main__":
main()