PyDCD:一个基于深度学习的Python社区检测软件

pydcd的Python项目详细描述


PyDCD:Python中基于深度学习的大规模网络社区检测软件

DCD(Deep learning-based Community Detection)旨在应用最先进的深度学习技术来识别大规模网络中的社区。与现有的社区检测方法相比,DCD为多种多样的社区检测问题提供了统一的解决方案。在

DCD logo

DCD提供4种社区检测算法、1种评估和两种网络数据类型的实现:

FunctionDescriptionInputOutput
KMeansClustering baseline method (1)Network node file Network edge file K<node id, community id>
MMClustering baseline method (2)Network node file Network edge file<node id, community id>
DCDDCDNetwork node file Network edge file K<node id, community id>
DCD+Variant of GCN with node attributesNetwork node file with attributes Network edge file K<node id, community id>
EvaluationEvaluate the performanceNetwork node file Network edge file Community assignmentperformance value
Random networkGenerate random network datasetsNetwork 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 networkImport Facebook brand-brand networkNoneFacebook dataset
Citation networkImport citation networkNoneCitation 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教授开发的。在

引文

如果您认为这对您的研究或开发有用,请引用我们的工作。在

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java mahout创建带有首选项的基于项目的推荐程序   java Maven:过滤任何资源   swing为什么Java中的侦听器相互依赖?   java在TextView中显示json响应   drjava从txt文件中检索一个随机字,但没有得到任何输出,也没有编译错误   JWindow上的java JPanel,添加组件   安卓使用jcocoa将ios代码转换为java   除非调整帧的大小,否则java动画不起作用   从java代码创建Json文件   java使用jdom向现有xml添加内容   如何在java中设置socket写超时?   java将值拆分为两个随机数