PyDCD:一个基于深度学习的Python社区检测软件
pydcd的Python项目详细描述
PyDCD:Python中基于深度学习的大规模网络社区检测软件
DCD(Deep learning-based Community Detection)旨在应用最先进的深度学习技术来识别大规模网络中的社区。与现有的社区检测方法相比,DCD为多种多样的社区检测问题提供了统一的解决方案。在
DCD提供4种社区检测算法、1种评估和两种网络数据类型的实现:
Function | Description | Input | Output |
---|---|---|---|
KMeans | Clustering baseline method (1) | Network node file Network edge file K | <node id, community id> |
MM | Clustering baseline method (2) | Network node file Network edge file | <node id, community id> |
DCD | DCD | Network node file Network edge file K | <node id, community id> |
DCD+ | Variant of GCN with node attributes | Network node file with attributes Network edge file K | <node id, community id> |
Evaluation | Evaluate the performance | Network node file Network edge file Community assignment | performance value |
Random network | Generate random network datasets | Network size Community size Probability of edges within communities Probability of edges between communities Directed network flag | <node id, community id> Network node file Network edge file |
Facebook network | Import Facebook brand-brand network | None | Facebook dataset |
Citation network | Import citation network | None | Citation dataset |
要求
通常,该库与python3.6/3.7兼容。在
安装
来自Conda
conda install -c pydcd
从PIP
^{pr2}$来源
安装之前,请确保已安装conda
。在
git clone https://github.com/kpzhang/deepcommunitydetection cd deepcommunitydetection conda install -y --file conda/requirements.txt mkdir build cd build && cmake .. && make &&cd - cd python && python setup.py install &&cd -
快速入门
下面是一个快速入门示例。在
Python 3.7.3 (default, January 012020, 09:00:00)[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin Type "help", "copyright", "credits" or "license"for more information. >>> from pydcd import DCD, KM, MM >>> kmeans_detector= KM(10) >>> kmeans_detector.km_detect_community('fb_nodes.txt','fb_edges.txt','N')# N means no evaluation >>> mm_detector= MM() >>> mm_detector.mm_detect_community('fb_nodes.txt','fb_edges.txt','Y')# Y means showing evaluation >>> dcd_detector= DCD()# using default setting for initialization, or >>> dcd_detector= DCD(128,64,128,50)# set the neurons for three hidden layers and the output dimension >>> dcd_detector.dcd_detect_community('fb_nodes.txt','fb_edges.txt','Y','N')# Y means nodes having attributes >>> dcd_detector.dcd_detect_community('fb_nodes.txt','fb_edges.txt','N','N')# The first N means nodes no attributes >>> rn= RandNet()# to generate random networks >>> rn.generate_random_networks(1000,100,0.2,0.05)# undirected network with 1000 nodes and 100 communities >>> rn.generate_random_networks(1000,100,0.2,0.05,directed=True)# directed network with 1000 nodes and 100 communities
输入示例
没有属性的节点文件:
node_id_1 node_id_2 node_id_3 ... node_id_n
具有属性的节点文件:
node_id_1 <tab> value_for_attribute_1 value_for_attribute_2 ... value_for_attribute_m node_id_2 <tab> value_for_attribute_1 value_for_attribute_2 ... value_for_attribute_m node_id_3 <tab> value_for_attribute_1 value_for_attribute_2 ... value_for_attribute_m ... node_id_n <tab> value_for_attribute_1 value_for_attribute_2 ... value_for_attribute_m
边缘文件:
node_id_1 node_id_2 ... node_id_i node_id_j ... node_id_m node_id_k
开发团队
PyDCD是由Kunpeng Zhang教授、Shaokun Fan教授和Bruce Golden教授开发的。在
引文
如果您认为这对您的研究或开发有用,请引用我们的工作。在
- 项目
标签: