-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaw.py
More file actions
32 lines (23 loc) · 847 Bytes
/
law.py
File metadata and controls
32 lines (23 loc) · 847 Bytes
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
27
28
29
30
31
32
from model.graph_mcmc import Graph_MCMC
def run():
dataset = "law_firm"
graph = Graph_MCMC()
#graph.read_from_gt("cond-mat")
graph.read_from_ns(dataset)
graph.remove_property("_pos")
graph.remove_property("name")
graph.remove_property("nodeAge")
graph.convert_props_to_flags()
#graph.filter_edges("layer", 3) # 1: coworkers, 2: friendship, 3: advice
graph.partition(B_min=2, B_max=10)
graph.mcmc(1000)
graph.draw(dataset + ".png")
classifier = graph.sample_classifier_marginals(2500, step_scaling=0.01)
names = graph.get_feature_names()
classifier.thin_samples()
classifier.plot_sampled_weights(names, std_dev_multiplier=2)
classifier.plot_sample_histogram()
classifier.plot_sample_history()
if __name__ == "__main__":
print("Analysing chosen dataset")
run()