Giter VIP home page Giter VIP logo

code's Introduction

Classifying community structure types in networks

This code accompanies the paper "Non-assortative relationships between groups of nodes are common in complex networks", by Cathy Liu, Tristram J. Alexander, and Eduardo G. Altmann, PNAS Nexus (2023).

The analysis is performed in two steps:

  1. Given a network (in folder Data/), use one of the 5 community-detection methods (SBM, Louvain, Spectral, Infomap, or DNGR, see below) to partition the nodes in groups (stored in the folder Output/).

  2. Given a network partition (in folder Output/), classify the relationship between groups/communities in one of the four types: Assortative, Disassortative, Core-Periphery, or Source-Basin.

The Tutorial.ipynb notebook shows how to compute the partitions (step 1) and analyze pre-computed partitions of 52 networks and 5 methods (step 2).

Community detection methods

Method Reference Requirement
SBM Bayesian stochastic blockmodeling graph-tool
Louvain Fast unfolding of communities in large networks python-louvain
Spectral Revisiting the Bethe-Hessian: Improved CommunityDetection in Sparse Heterogeneous Graphs codes
Infomap Maps of random walks on complex networks reveal community structure infomap
DNGR Deep neural networks for learning graph representations DNGR-Keras under python3.6

Repository structure:

  1. The notebooks show examples of data analysis:
  • Tutorial.ipynb: exemplifies the complete data analysis in one network.
  • DataSurvey.ipynb: full data analysis pipeline used in the paper (52 networks), including: i) choose datasets in 5 domains from repository Netzschleuder; ii) classify structure type for each network iii) produce summary figures (Fig. 4 in paper) 4) and analyse two case studies.
  1. src: python files used to produce our result.
  • GenModel.py contains 5 community detection methods with each method running in a seperate file: SBM.py,Louvain, clustering_more.py, Infomap.py and DNGR.py

  • summary_stats.py includes the interaction classification functions;

  • Robustness.py includes the boostrapping method to comptue the robustness of the classifications;

  • Null.py includes the density null model;

  • Converter.py and preprocess.py include helper functions to convert networks between networkx and graph_tool

  • summary_stats_all.py is used in DataSurvey.ipynb with more summary functions

  1. Data: this folder contains the datasets used in our case study, including the 52 cases downloaded from Netzschleuder. Additional datasets can be stored and analyzed from here.

  2. Outputs: This folder contains community partition results by 5 methods in 52 networks in 5 domains (Online&Social, Economic, Biological, Technological, Informational).

code's People

Contributors

edugalt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.