Package: graph-ensembles
Graph ensemblesThe 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.Free software: GNU General Public License v3Documentation:https://graph-ensembles.readthedocs.io.InstallationInstall using:pipinstallgraph_ensemblesUsageCurrently only the RandomGraph and StripeFitnessModel are fully implemented.
An example of how it can be used is the following.
For more see the example notebooks in the examples folder.importgraph_ensemblesasgeimportpandasaspdv=pd.DataFrame([['ING','NL'],['ABN','NL'],['BNP','FR'],['BNP','IT']],columns=['name','country'])e=pd.DataFrame([['ING','NL','ABN','NL',1e6,'interbank',False],['BNP','FR','ABN','NL',2.3e7,'external',False],['BNP','IT','ABN','NL',7e5,'interbank',True],['BNP','IT','ABN','NL',3e3,'interbank',False],['ABN','NL','BNP','FR',1e4,'interbank',False],['ABN','NL','ING','NL',4e5,'external',True]],columns=['creditor','c_country','debtor','d_country','value','type','EUR'])g=ge.MultiDiGraph(v,e,v_id=['name','country'],src=['creditor','c_country'],dst=['debtor','d_country'],edge_label=['type','EUR'],weight='value')# Initialize modelmodel=ge.MultiFitnessModel(g)# Fit model parametersmodel.fit()# Sample from the ensemblemodel.sample()DevelopmentPlease work on a feature branch and create a pull request to the development
branch. If necessary to merge manually do so without fast forward:gitmerge--no-ffmyfeatureTo build a development environment run:python3-mvenvenvsourceenv/bin/activatepipinstall-e.pipinstall-rrequirements.txtFor testing:pytest--covCreditsThis is a project byLeonardo Niccolò IalongoandEmiliano Marchese, under
the supervision ofDiego Garlaschelli.History0.3.5 (2023-02-14)Corrected distribution files for missing models0.3.4 (2023-02-13)Corrected sampling with ConditionalInvariantModelAdded new weighted sampling method for aggregate graphs0.3.3 (2023-12-25)Added the sparse ConditionalInvariantModelCorrected issues with CremB sampling0.3.2 (2023-12-01)Improved and corrected support for the computation of average nearest neighbour properties and degrees.0.3.1 (2023-11-20)Added to the spark module a function to compute the confusion matrix elements at various thresholds of the probability matrix.0.3.0 (2023-11-03)Major update of graph classes into four new categories (Graph, DiGraph, MultiGraph, MultiDiGraph) in line with Networkx.Cleaned up models and organized in three modules (dense, sparse, spark) based on how the computations are performed and results are stored.Introduced better inheritance through Ensemble classes based on the newly defined graph classes.Added testing in spark and updated testing of MultiDiGraph Ensemble classes.0.2.3 (2023-07-03)Improved and corrected spark submodule.0.2.2 (2023-05-11)Created submodule spark for allowing some models to be parallelize computations using spark0.2.1 (2021-08-03)Added option for faster computation of average nearest neighbour properties by allowing for multiple links between the same nodes.Added compression option in to_networkx function.0.2.0 (2021-07-12)Added likelihood and nearest neighbour properties.Revisited API for measures to ensure correct recompute if necessary.0.1.3 (2021-04-29)Added new option for fitting the stripe model that ensures that the minimum non-zero expected degree is oneCorrected issue in expected degree calculations0.1.2 (2021-04-07)Added scale invariant probability functional to all modelsImproved methods for convergence with change in API, xtol now a relative measureAdded pagerank and trophic depth to the libraryAdded methods for graph conversion to networkxAdded methods for computing the adjacency matrix as a sparse matrix0.1.1 (2021-03-29)Fixed bug in stripe expected degree computationAdded testing of expected degree performance0.1.0 (2021-03-29)Added the block model and group info to graphsAdded fast implementation of theoretical expected degreesFixed some compatibility issues with multiple item assignments0.0.4 (2021-03-15)Fixed issues with slow pandas index conversion0.0.3 (2021-03-14)Large changes in API with great improvements in usabilityAdded sampling functionAdded RandomGraph modelAdded Graph classes for ease of use0.0.2 (2020-11-13)Added steps for CI.Corrected broken links.Removed support for python 3.5 and 3.60.0.1 (2020-10-28)First release on PyPI. StripeFitnessModel available, all other model classes still dummies.