-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmisc.py
More file actions
29 lines (20 loc) · 713 Bytes
/
misc.py
File metadata and controls
29 lines (20 loc) · 713 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
from model.graph_mcmc import Graph_MCMC
def run():
dataset = "webkb/webkb_washington_cocite"
graph = Graph_MCMC()
graph.read_from_ns(dataset)
graph.remove_property("_pos")
graph.remove_property("name")
graph.convert_props_to_flags()
graph.partition(B_min=2, B_max=10)
graph.mcmc(1000)
graph.draw("webkb.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()