-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblogs.py
More file actions
24 lines (19 loc) · 688 Bytes
/
blogs.py
File metadata and controls
24 lines (19 loc) · 688 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
from data.polblogs import PolBlog
from model.graph_mcmc import Graph_MCMC
def run():
graph = Graph_MCMC()
graph.read_from_file("polblogs.gml")
graph.filter_out_low_degree(2)
graph.remove_property("label")
graph.remove_property("source")
graph.partition(B_min=1, B_max=2)
graph.mcmc(100, verbose=True)
graph.draw("polblogs.png")
classifier = graph.sample_classifier_mala(10000, step_scaling=0.01, verbose=True)
classifier.thin_samples()
classifier.plot_sampled_weights(["Right-Wingness"])
classifier.plot_sample_histogram()
classifier.plot_sample_history()
if __name__ == "__main__":
print("Analysing political blogs")
run()