summaryrefslogtreecommitdiff
path: root/scripts/config.py
diff options
context:
space:
mode:
authorYurenHao0426 <blackhao0426@gmail.com>2026-02-24 08:40:49 +0000
committerYurenHao0426 <blackhao0426@gmail.com>2026-02-24 08:40:49 +0000
commit8f63cf9f41bbdb8d55cd4679872d2b4ae2129324 (patch)
treeab5c95888849e854f2346db856c7edece7c8b8a7 /scripts/config.py
EC-SBM community detection analysis: full pipeline and writeup
Implement community detection on 3 EC-SBM networks (polblogs, topology, internet_as) using 5 methods (Leiden-Mod, Leiden-CPM at 0.1 and 0.01, Infomap, graph-tool SBM). Compute AMI/ARI/NMI accuracy, cluster statistics, and generate figures and LaTeX report.
Diffstat (limited to 'scripts/config.py')
-rw-r--r--scripts/config.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/scripts/config.py b/scripts/config.py
new file mode 100644
index 0000000..b23b090
--- /dev/null
+++ b/scripts/config.py
@@ -0,0 +1,32 @@
+"""Central configuration for EC-SBM community detection analysis."""
+
+import os
+
+BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+DATA_DIR = os.path.join(BASE_DIR, "data")
+RESULTS_DIR = os.path.join(BASE_DIR, "results")
+
+NETWORKS = {
+ "polblogs": {
+ "edge_tsv": os.path.join(DATA_DIR, "polblogs", "edge.tsv"),
+ "com_gt_tsv": os.path.join(DATA_DIR, "polblogs", "com_gt.tsv"),
+ },
+ "topology": {
+ "edge_tsv": os.path.join(DATA_DIR, "topology", "edge.tsv"),
+ "com_gt_tsv": os.path.join(DATA_DIR, "topology", "com_gt.tsv"),
+ },
+ "internet_as": {
+ "edge_tsv": os.path.join(DATA_DIR, "internet_as", "edge.tsv"),
+ "com_gt_tsv": os.path.join(DATA_DIR, "internet_as", "com_gt.tsv"),
+ },
+}
+
+METHODS = [
+ {"name": "leiden_mod", "type": "leiden", "quality": "modularity"},
+ {"name": "leiden_cpm_01", "type": "leiden", "quality": "cpm", "resolution": 0.1},
+ {"name": "leiden_cpm_001", "type": "leiden", "quality": "cpm", "resolution": 0.01},
+ {"name": "infomap", "type": "infomap"},
+ {"name": "graphtool_sbm", "type": "graphtool_sbm"},
+]
+
+SEED = 42