netrd
netrd: A library for network reconstruction and graph distances - Published in JOSS (2021)
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
Repository
A library for network {reconstruction, distances, dynamics}
Basic Info
- Host: GitHub
- Owner: netsiphd
- License: mit
- Language: Python
- Default Branch: master
- Homepage: https://netrd.readthedocs.io/en/latest/
- Size: 62.2 MB
Statistics
- Stars: 170
- Watchers: 10
- Forks: 43
- Open Issues: 15
- Releases: 5
Metadata Files
README.md
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
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
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
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
- Website: http://networkscienceinstitute.org/
- Repositories: 6
- Profile: https://github.com/netsiphd
JOSS Publication
netrd: A library for network reconstruction and graph distances
Authors
Tags
network science network reconstruction graph distance network dynamicsPapers & Mentions
Total mentions: 1
Network comparison and the within-ensemble graph distance
- DOI: 10.1098/rspa.2019.0744
- OpenAlex ID: https://openalex.org/W3047462403
- Published: November 2020
GitHub Events
Total
- Watch event: 5
Last Year
- Watch event: 5
Committers
Last synced: 5 months ago
Top Committers
| Name | 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
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}
- Homepage: https://github.com/netsiphd/netrd
- Documentation: https://netrd.readthedocs.io/
- License: MIT License
-
Latest release: 0.3.0
published over 4 years ago
Rankings
Dependencies
- 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
