Package: pydcd
PyDCD: A Deep Learning-Based Community Detection Software in Python for Large-scale NetworksDCD (Deep learning-based Community Detection) is designed to apply state-of-the-art deep learning technologies to identify communities for large-scale networks. Compared with existing community detection methods, DCD offers a unified solution for many variations of community detection problems.DCD provides implementation of 4 community detection algorithms, 1 evaluation, and two types of networked data:FunctionDescriptionInputOutputKMeansClustering baseline method (1)Network node fileNetwork edge fileK<node id, community id>MMClustering baseline method (2)Network node fileNetwork edge file<node id, community id>DCDDCDNetwork node fileNetwork edge fileK<node id, community id>DCD+Variant of GCN with node attributesNetwork node file with attributesNetwork edge fileK<node id, community id>EvaluationEvaluate the performanceNetwork node fileNetwork edge fileCommunity assignmentperformance valueRandom networkGenerate random network datasetsNetwork sizeCommunity sizeProbability of edges within communitiesProbability of edges between communitiesDirected network flag<node id, community id>Network node fileNetwork edge fileFacebook networkImport Facebook brand-brand networkNoneFacebook datasetCitation networkImport citation networkNoneCitationdatasetRequirementsGenerally, the library is compatible with Python 3.6/3.7.InstallationFrom Condacondainstall-cpydcdFrom PIPpip3installPyDCDFrom SourceBefore installation, make sure you havecondainstalled.gitclonehttps://github.com/kpzhang/deepcommunitydetectioncddeepcommunitydetection
condainstall-y--fileconda/requirements.txt
mkdirbuildcdbuild&&cmake..&&make&&cd-cdpython&&pythonsetup.pyinstall&&cd-Quick StartHere is a quick-start example.Python3.7.3(default,January012020,09:00:00)[Clang4.0.1(tags/RELEASE_401/final)]::Anaconda,Inc.ondarwin
Type"help","copyright","credits"or"license"formoreinformation.

>>>frompydcdimportDCD,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 communitiesInput Examplesnode file without attributes:node_id_1
node_id_2
node_id_3
...
node_id_nnode file with attributes:node_id_1<tab>value_for_attribute_1value_for_attribute_2...value_for_attribute_m
node_id_2<tab>value_for_attribute_1value_for_attribute_2...value_for_attribute_m
node_id_3<tab>value_for_attribute_1value_for_attribute_2...value_for_attribute_m
...
node_id_n<tab>value_for_attribute_1value_for_attribute_2...value_for_attribute_medge file:node_id_1node_id_2
...
node_id_inode_id_j
...
node_id_mnode_id_kDevelopment TeamPyDCD is developed by Prof.Kunpeng Zhang, Prof.Shaokun Fan, and Prof.Bruce Golden.CitationIf you find this useful for your research or development, please cite our work.