Skip to main content

The graph ensemble package contains a set of methods to build fitness based graph ensembles from marginal information.

Project description

https://travis-ci.com/LeonardoIalongo/graph-ensembles.svg?branch=master

Graph ensembles

The graph ensemble package contains a set of methods to build fitness based graph ensembles from marginal information. These methods can be used to build randomized ensembles preserving the marginal information provided.

Installation

Install using:

pip install graph_ensembles

Usage

Currently only the StripeFitnessModel is fully implemented. An example of how it can be used is the following. For more see the example notebooks in the examples folder.

# Define graph marginals
 out_strength = np.array([[0, 0, 2],
                         [1, 1, 5],
                         [2, 2, 6],
                         [3, 2, 1]])

 in_strength = np.array([[0, 1, 5],
                         [0, 2, 4],
                         [1, 2, 3],
                         [3, 0, 2]])

 num_nodes = 4
 num_links = np.array([1, 1, 3])

 # Initialize model
 model = ge.StripeFitnessModel(out_strength, in_strength, num_links)

 # Fit model parameters
 model.fit()

 # Return probability matrix
 prob_mat = model.probability_matrix

Development

Please work on a feature branch and create a pull request to the development branch. If necessary to merge manually do so without fast forward:

git merge --no-ff myfeature

To build a development environment run:

python3 -m venv venv
source venv/bin/activate
pip install -e '.[dev]'

For testing:

pytest --cov

Credits

This is a project by Leonardo Niccolò Ialongo and Emiliano Marchese, under the supervision of Diego Garlaschelli.

History

0.0.2 (2020-11-13)

  • Added steps for CI.

  • Corrected broken links.

  • Removed support for python 3.5 and 3.6

0.0.1 (2020-10-28)

  • First release on PyPI. StripeFitnessModel available, all other model classes still dummies.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

graph_ensembles-0.0.2.tar.gz (151.0 kB view hashes)

Uploaded Source

Built Distribution

graph_ensembles-0.0.2-py3-none-any.whl (10.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page