netrd

netrd: A library for network reconstruction and graph distances - Published in JOSS (2021)

https://github.com/netsiphd/netrd

Science Score: 95.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 10 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: arxiv.org, joss.theoj.org
  • Committers with academic emails
    5 of 24 committers (20.8%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Scientific Fields

Artificial Intelligence and Machine Learning Computer Science - 83% confidence
Last synced: 4 months ago · JSON representation

Repository

A library for network {reconstruction, distances, dynamics}

Basic Info
Statistics
  • Stars: 170
  • Watchers: 10
  • Forks: 43
  • Open Issues: 15
  • Releases: 5
Created almost 7 years ago · Last pushed almost 3 years ago
Metadata Files
Readme Contributing License

README.md

DOI PyPI version ReadTheDocs CI

netrd: A library for network {reconstruction, distances, dynamics}

This library provides a consistent, NetworkX-based interface to various utilities for graph distances, graph reconstruction from time series data, and simulated dynamics on networks.

Some resources that maybe of interest:

Installation

netrd is easy to install through pip:

pip install netrd

If you are thinking about contributing to netrd, you can install a development version by executing

git clone https://github.com/netsiphd/netrd cd netrd pip install .

Usage

Reconstructing a graph

example reconstruction

The basic usage of a graph reconstruction algorithm is as follows:

```python from netrd.reconstruction import CorrelationMatrix import numpy as np

100 nodes, 1000 observations

TS = np.random.random((100, 1000))

reconstructor = CorrelationMatrix() G = reconstructor.fit(TS, thresholdtype='degree', avgk=15)

or alternately, G = reconstructor.results['graph']

```

Here, TS is an N x L numpy array consisting of L observations for each of N sensors. This constrains the graphs to have integer-valued nodes.

The results dict object, in addition to containing the graph object, may also contain objects created as a side effect of reconstructing the network, which may be useful for debugging or considering goodness of fit. What is returned will vary between reconstruction algorithms.

Many reconstruction algorithms create a dense matrix of weights and use additional parameters to describe how to create a sparse graph; the tutorial has more details on these parameters.

Distances between graphs

example distance

The basic usage of a distance algorithm is as follows:

```python from netrd.distance import QuantumJSD import networkx as nx G1 = nx.fastgnprandomgraph(1000, .1) G2 = nx.fastgnprandomgraph(1000, .1)

distobj = QuantumJSD() distance = distobj.dist(G1, G2)

or alternatively: distance = dist_obj.results['dist']

```

Here, G1 and G2 are nx.Graph objects (or subclasses such as nx.DiGraph). The results dictionary holds the distance value, as well as any other values that were computed as a side effect.

Dynamics on graphs

example distance

The basic usage of a dynamics algorithm is as follows:

```python from netrd.dynamics import VoterModel import networkx as nx groundtruth = nx.karateclub_graph()

dynamicsmodel = VoterModel() syntheticTS = dynamicsmodel.simulate(groundtruth, 1000)

this is the same structure as the input data to a reconstructor

G = CorrelationMatrix().fit(synthetic_TS)

```

This produces a numpy array of time series data.

Contributing

Contributing guidelines can be found in CONTRIBUTING.md.

Publications

  • McCabe, S., Torres, L., LaRock, T., Haque, S. A., Yang, C.-H., Hartle, H., and Klein, B. (2021). netrd: A library for network reconstruction and graph distances. Journal of Open Source Software 6(62): 2990. doi: 10.21105/joss.02990. arXiv: 2010.16019.

    • paper detailing the methods used in this package
  • Hartle H., Klein B., McCabe S., Daniels A., St-Onge G., Murphy C., and Hébert-Dufresne L. (2020). Network comparison and the within-ensemble graph distance. Proceedings of the Royal Society A 476: 20190744. doi: 10.1098/rspa.2019.0744. arXiv: 2008.02415.

    • recent work introducing a baseline measure for comparing graph distances

Owner

  • Name: NetSI PhD Students
  • Login: netsiphd
  • Kind: user

JOSS Publication

netrd: A library for network reconstruction and graph distances
Published
June 01, 2021
Volume 6, Issue 62, Page 2990
Authors
Stefan McCabe ORCID
Network Science Institute, Northeastern University, Boston, MA, USA
Leo Torres ORCID
Network Science Institute, Northeastern University, Boston, MA, USA
Timothy LaRock ORCID
Network Science Institute, Northeastern University, Boston, MA, USA
Syed Arefinul Haque ORCID
Network Science Institute, Northeastern University, Boston, MA, USA
Chia-Hung Yang ORCID
Network Science Institute, Northeastern University, Boston, MA, USA
Harrison Hartle ORCID
Network Science Institute, Northeastern University, Boston, MA, USA
Brennan Klein ORCID
Network Science Institute, Northeastern University, Boston, MA, USA, Laboratory for the Modeling of Biological and Socio-Technical Systems, Northeastern University, Boston, USA
Editor
Arfon Smith ORCID
Tags
network science network reconstruction graph distance network dynamics

Papers & Mentions

Total mentions: 1

Network comparison and the within-ensemble graph distance
Last synced: 3 months ago

GitHub Events

Total
  • Watch event: 5
Last Year
  • Watch event: 5

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 454
  • Total Committers: 24
  • Avg Commits per committer: 18.917
  • Development Distribution Score (DDS): 0.555
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
sdmccabe@github.com s****e@g****m 202
leotrs l****o@l****m 48
Tim LaRock t****k@g****m 46
Brennan Klein b****n@B****l 38
chiahungyang y****i@h****u 21
Brennan Klein k****r@h****u 18
Guillaume St-Onge g****4@u****a 17
Andy Mellor m****1@h****k 10
charlesmurphy1 c****1@u****a 10
Harry Hartle h****h@H****l 8
Carolina Mattsson m****c@h****u 8
David Saffo s****d@h****u 8
Chia-Hung Yang 4****g 3
Ryan J. Gallagher r****g@g****m 3
Jessica j****6@g****m 2
Matteo Chinazzi m****i@g****m 2
Alex Gates a****2@g****m 2
rer r****r@c****u 2
Anton Tsitsulin a****n@g****m 1
Brennan Klein b****n@g****m 1
DJ Passey d****r@g****m 1
Keigo Kusumegi 5****g 1
NetSI PhD Students 4****d 1
netisiphd 4****d 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 32
  • Total pull requests: 68
  • Average time to close issues: 2 months
  • Average time to close pull requests: 6 days
  • Total issue authors: 3
  • Total pull request authors: 8
  • Average comments per issue: 3.16
  • Average comments per pull request: 1.9
  • Merged pull requests: 64
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • sdmccabe (28)
  • leotrs (3)
  • jkbren (1)
Pull Request Authors
  • sdmccabe (47)
  • jkbren (12)
  • chiahungyang (3)
  • leotrs (2)
  • tlarock (1)
  • Keygoksmg (1)
  • djpasseyjr (1)
  • netsiphd (1)
Top Labels
Issue Labels
enhancement (12) bug (5) question (4) help wanted (3) good first issue (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 146 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 5
  • Total versions: 9
  • Total maintainers: 2
pypi.org: netrd

netrd: A library for network {reconstruction, distances, dynamics}

  • Versions: 9
  • Dependent Packages: 0
  • Dependent Repositories: 5
  • Downloads: 146 Last month
Rankings
Stargazers count: 5.8%
Forks count: 6.3%
Dependent repos count: 6.6%
Average: 9.3%
Dependent packages count: 10.0%
Downloads: 17.8%
Maintainers (2)
Last synced: 4 months ago

Dependencies

requirements.txt pypi
  • Sphinx ==2.0.1
  • networkx >=2.2.0
  • numpy >=1.16.0
  • numpydoc >=0.9
  • ortools >=6.7
  • scikit-learn >=0.18.2
  • scipy >=1.0.0
  • sphinx-rtd-theme >=0.4