Skip to content

Commit

Permalink
finishing config file (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
crangelsmith committed Mar 5, 2020
1 parent c4c906d commit 5454618
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 3 deletions.
2 changes: 0 additions & 2 deletions run-inputs/sgf-example-1.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
{
"num_samples_to_fit": -1,
"random_state": 1234,

"gamma": 4,
"omega": 7,
//"vars_sequence":[1,2,3,4,5,8,6,7,8], this should be a topological order infered from the data.
"ncomp": "adv",
"ndist": "geom"
}
Expand Down
37 changes: 36 additions & 1 deletion synth-methods/plausible-deniability/prepare_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def write_cfg(parameters_dict, filename):
omega={d['omega']}
ncomp={d['ncomp']}
ndist={d['ndist']}
max_ps=10000
max_ps=0
max_check_ps=0
workdir={d['workdir']}
dataprefix={d['dataprefix']}
Expand All @@ -42,6 +42,39 @@ def write_cfg(parameters_dict, filename):
f.write(cfg)


def write_dag(corr, filename):
# short name for the string interpolation
dag = f"""8, {corr}
0
0
0
0
0
0
0
"""
with open(filename, "w") as f:
f.write(dag)


def write_order(filename):
# short name for the string interpolation
order = f"""2
3
4
5
6
7
8
1
"""
with open(filename, "w") as f:
f.write(order)





def write_attrs(data, filename):
with open(filename, "w") as f:
for col in data.columns:
Expand Down Expand Up @@ -100,6 +133,8 @@ def main():
## write "attrs" and "grps"
write_attrs(data, dataprefix + "_attrs.csv")
write_grps(data, dataprefix + "_grps.csv")
write_dag(0.95, dataprefix + "_dag.csv")
write_order(dataprefix + "_order.csv")


if __name__=="__main__":
Expand Down

0 comments on commit 5454618

Please sign in to comment.