GithubHelp home page GithubHelp logo

philipplorenz / memory_community_matching Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 2.0 10 KB

Matching procedure for tracing communities in temporal data

Home Page: http://www.itp.tu-berlin.de/?lorenz

License: MIT License

Python 100.00%
community-detection memory-matching temporal-networks

memory_community_matching's Introduction

Matching for Temporal Community Detection with Memory

This package implements a matching procedure for temporal community detection on networks. The details are in our paper: [https://doi.org/10.1007/978-3-319-72150-7_33] This is part of a modular approach to temporal community detection: for a complete analysis pipeline, additional tools are needed.

Dependencies

  • python3
  • numpy
  • scipy.optimize

Input

We want to find temporal communities in a network. The first part is to use community detection on the timeseries of static snapshots of the temporal network. The static community detection is not implemented in this package.

The input data for this package is a list of items (network nodes) and their membership in static communities for each timestep of the timeseries. We use a dict of python sets for each timestep (see test.py).

Output

The output is a list, containing for each detected temporal community a set of its members as a tuple of (timestep, community name).

Memory

The results of the static communtity detection are matched with the results from adjacent timesteps to get a temporal community detection. Memory is used to match communities against other communities from past timestepts. The length of memory and the memory kernel with weights for each memory length can be adjusted using the memory and memory_weights parameters.

Our method goes through the data chronologically and matches communites backwards to all previous timesteps within the memory length. The Hungarian algorithm is used for matching. It maximizes the sum of all memory weighted jaccard indices between all communities within the memory length.

Example

import memory_community_matching

timeseries = [

        { 'orange': { 1, 2, 3 },
          'violet': { 4, 5, 6 },
          'green':  { 7, 8, 9 } },

        { 'violet': { 2, 3, 4, 5, 6 },
          'green':  { 7, 8 },
          'yellow': { 9 } },

        { 'orange': { 1, 2, 3 },
          'violet': { 4, 5, 6, 7 },
          'green':  { 8, 9 } }
    ]

temporal_communities = memory_community_matching.matching(timeseries, 2)
print(temporal_communties)
# [{(0, 'violet'), (1, 'violet'), (2, 'violet')}, {(0, 'orange'), (2, 'orange')}, {(2, 'green'), (1, 'green'), (0, 'green')}]

Authors

If you reference this method, please cite

Lorenz P., Wolf F., Braun J., Djurdjevac Conrad N., Hövel P. (2018) Capturing the Dynamics of Hashtag-Communities. In: Cherifi C., Cherifi H., Karsai M., Musolesi M. (eds) Complex Networks & Their Applications VI. COMPLEX NETWORKS 2017. Studies in Computational Intelligence, vol 689. Springer, Cham

[https://doi.org/10.1007/978-3-319-72150-7_33]

memory_community_matching's People

Contributors

jonas-braun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.