Describe#
Generate methods-section text and citations for a backbone – the
counterpart of the narrative option of Neal’s Backbone 3.0. See the
Validating a Backbone tutorial for a worked example, and
From a hairball to a backbone, end to end for its place
at the end of the whole workflow.
Methods-section text and citations for a backbone.
describe_backbone() is the counterpart of the
narrative option of Neal’s Backbone 3.0 R package: it returns a short methods paragraph naming
the method and its null model, the parameters, the multiple-testing
correction, how much of the network was kept, and the papers to cite
(including this package and its version).
The text is built from one registry, METHODS, which maps the name of
every public scoring or extraction function to a one-sentence description and
the keys of its references in REFERENCES (taken from the functions’
own References sections). The coverage policy is:
Described: every public function of the
statistical,structural,proximity,hybrid,bipartite,hypergraph,unweightedandtemporalmodules that scores edges (or nodes, pairs or hyperedges) or extracts a backbone, including the bipartite projections. Short aliases such asdisparityorsvhand the method names accepted by the dispatch wrappers ("global","simple", …) are resolved throughALIASES.Not described (
EXCLUDED, with the reason for each): the dispatch wrappers (describe the method they dispatch to), null-model building blocks (bicm,fastball), hypergraph helpers that are not backbones, result classes, and the temporal-network format conversions oftemporal(that module also holds the temporal backbone methods, so it is not a helper module).The helper modules
filters,measures,hypergraph_io,visualization,describeandconvertare not methods and are skipped.
SCORE_KEYS maps each static weighted or unweighted method to the
edge attribute a cut uses (its p-value, score or *_keep flag);
backbone_stability() reads it to apply the same cut
to every snapshot.
The test suite checks that every public name falls in one of these groups, so a new method cannot be added without a registry entry.
Methods currently in the registry:
disparity_filter()– the disparity filter (Serrano et al., 2009)noise_corrected_filter()– the noise-corrected filter (Coscia & Neffke, 2017)marginal_likelihood_filter()– the marginal likelihood filter (Dianati, 2016)ecm_filter()– the enhanced configuration model (ECM) filter (Gemmetto et al., 2017)lans_filter()– locally adaptive network sparsification (LANS) (Foti et al., 2011)multiple_linkage_analysis()– multiple linkage analysis (MLA) (Van Nuffel, 2007; Van Nuffel et al., 2010; Weaver, 1954; Yassin et al., 2023)polya_filter()– the Pólya filter (Marcaccioli & Livan, 2019)gloss_filter()– the global statistical significance (GloSS) filter (Radicchi et al., 2011)global_threshold_filter()– a global weight thresholdstrongest_n_ties()– the strongest-n-ties ruleglobal_sparsification()– global sparsification (Satuluri et al., 2011)primary_linkage_analysis()– primary linkage analysis (Nystuen & Dacey, 1961)edge_betweenness_filter()– an edge-betweenness filter (Girvan & Newman, 2002)node_degree_filter()– a node-degree filter (Freeman, 1978)high_salience_skeleton()– the high-salience skeleton (Grady et al., 2012)metric_backbone()– the metric backbone (Simas et al., 2021)ultrametric_backbone()– the ultrametric backbone (Simas et al., 2021)doubly_stochastic_filter()– the doubly stochastic filter (Slater, 2009)h_backbone()– the h-backbone (Zhang et al., 2018)modularity_backbone()– the modularity backbone (Rajeh et al., 2022)planar_maximally_filtered_graph()– the planar maximally filtered graph (PMFG) (Tumminello et al., 2005)maximum_spanning_tree_backbone()– the maximum spanning treeneighborhood_overlap()– neighborhood overlapjaccard_backbone()– Jaccard similarity (Jaccard, 1901)dice_backbone()– Dice similarity (Dice, 1945)cosine_backbone()– cosine (Salton) similarity (Salton & McGill, 1983)hub_promoted_index()– the hub promoted index (Ravasz et al., 2002)hub_depressed_index()– the hub depressed index (Ravasz et al., 2002)lhn_local_index()– the Leicht-Holme-Newman local index (Leicht et al., 2006)preferential_attachment_score()– the preferential attachment index (Barabási & Albert, 1999)adamic_adar_index()– the Adamic-Adar index (Adamic & Adar, 2003)resource_allocation_index()– the resource allocation index (Zhou et al., 2009)graph_distance_proximity()– graph-distance proximity (Liben-Nowell & Kleinberg, 2007)local_path_index()– the local path index (Lü et al., 2009)glab_filter()– the globally and locally adaptive backbone (GLAB) (Zhang et al., 2014)simple_projection()– the simple bipartite projection (Coscia & Rossi, 2019)hyper_projection()– the hyperbolic bipartite projection (Coscia & Rossi, 2019; Newman, 2001; Newman, 2001)probs_projection()– the ProbS bipartite projection (Coscia & Rossi, 2019; Zhou et al., 2007)ycn_projection()– the YCN bipartite projection (Yildirim & Coscia, 2014; Coscia & Rossi, 2019)sdsm()– the stochastic degree sequence model (SDSM) (Neal, 2014)fdsm()– the fixed degree sequence model (FDSM) (Neal et al., 2021; Godard & Neal, 2022)fixedfill()– the fixed fill model (Neal et al., 2021)fixedrow()– the fixed row model (Neal et al., 2021)fixedcol()– the fixed column model (Neal et al., 2021)mdl_hypergraph_backbone()– the minimum description length (MDL) hypergraph backbone (Kirkley et al., 2026)local_mdl_hypergraph_backbone()– the local minimum description length (MDL) hypergraph backbone (Kirkley et al., 2026)maximal_hyperedges()– inclusion (toplex) reductionorder_filter()– an order filterstatistically_validated_hypergraph()– the statistically validated hypergraph (SVH) (Musciotto et al., 2021)statistically_validated_cores()– statistically validated cores (SVC) (Musciotto et al., 2021)sparsify()– the score-normalize-filter sparsification pipeline (Neal, 2022)lspar()– local sparsification (L-Spar) (Satuluri et al., 2011)local_degree()– the local degree backbone (Lindner et al., 2015; Hamann et al., 2016)observation_fraction()– the observation fractionpersistence()– edge persistencebackbone_stability()– backbone stabilityweight_trend()– the weight trendedge_persistence_hmm()– a two-state hidden Markov model of edge activitykalman_backbone()– Kalman smoothing of per-step edge significance (Kalman, 1960; Rauch et al., 1965)
- nx_backbone.describe_backbone(method, *, alpha=None, mtc='none', signed=False, original=None, backbone=None, style='text', **params)[source]#
Write a methods paragraph and citations for a backbone.
The counterpart of the
narrativeoption of Neal’s Backbone 3.0: the returned text names the method and its null model (or criterion), lists the parameters, states the multiple-testing correction, reports how much of the network the backbone keeps (viameasures) and cites the method’s papers and this package, with its installed version.- Parameters:
- methodstring or callable
Name of a backbone function such as
"disparity_filter", a short alias such as"disparity"or"svh", a method name accepted bybackbone()such as"global", or the function itself. Every described method is listed innx_backbone.describe.METHODS.- alphafloat or None, optional (default=None)
Significance level the p-values were compared with. Only valid for methods that produce p-values.
- mtcstring, optional (default=”none”)
Multiple-testing correction applied before thresholding, as passed to
threshold_filter()(seeadjust_pvalues()).- signedbool, optional (default=False)
Whether a two-tailed (signed) test was run. Only valid for methods that take a
signedargument.- originalgraph or iterable of hyperedges, optional
The input network. With backbone, the share of edges, nodes and weight kept is reported. For a temporal method, the scored graph the method returned; the number of steps and the binning are read from its
graph["temporal"]record (or that of backbone).- backbonegraph, iterable of hyperedges or result object, optional
The extracted backbone.
- style{“text”, “markdown”, “bibtex”}, optional (default=”text”)
"text"and"markdown"return the paragraph followed by a reference list;"bibtex"returns only the BibTeX entries.- **params
Other parameters used (for example
s=0.5orweight="weight"); they are listed in the paragraph. Aweightentry also names the edge attribute used for the weight share. Parameters that change the null model get a sentence of their own:aofdisparity_filter()(witha="ml"the estimate is read frombackbone.graph["disparity_a"]) andunitof the count-based scorers. Weight transforms recorded bytransform_weights()in the graph attributes of backbone (or else original) are reported too.
- Returns:
- descriptionstring
The paragraph and reference list, or BibTeX entries.
- Raises:
- ValueError
If method is not described in the registry, style or mtc is unknown, or alpha, mtc or signed is given for a method that does not support it.
- TypeError
If original or backbone has the wrong type for the method.
See also
threshold_filterApply alpha and mtc to a scored graph.
compare_backbonesCompare several backbones on the same measures.
Notes
The package is cited without a year (“n.d.”) because the version, not the date, identifies the code;
CITATION.cffin the repository carries the same metadata.Examples
A disparity-filter backbone of Les Misérables at
alpha = 0.05:>>> import networkx as nx >>> import nx_backbone as nb >>> G = nx.les_miserables_graph() >>> scored = nb.disparity_filter(G) >>> bb = nb.threshold_filter(scored, "disparity_pvalue", 0.05) >>> text = nb.describe_backbone( ... "disparity_filter", alpha=0.05, original=G, backbone=bb ... ) >>> print(text) We extracted the backbone with the disparity filter (Serrano et al., 2009), which tests each edge's weight against a null model in which each node's strength is spread uniformly at random over its edges. Edges were kept if their p-value was below alpha = 0.05, without correction for multiple comparisons. The backbone retains 9 of 254 edges (3.5%) and 10 of 77 non-isolated nodes (13.0%), and 17.1% of the total edge weight. Backbones were computed with nx-backbone version ... (Keegan, n.d.). References Keegan, B. C. (n.d.). nx-backbone: Backbone extraction algorithms for complex networks (Version ...) [Python package]. https://github.com/brianckeegan/nx-backbone Serrano, M. A., Boguñá, M., & Vespignani, A. (2009). Extracting the multiscale backbone of complex weighted networks. Proceedings of the National Academy of Sciences, 106(16), 6483-6488. https://doi.org/10.1073/pnas.0808904106
The BibTeX entries for an L-Spar backbone:
>>> print(nb.describe_backbone("lspar", s=0.5, style="bibtex")) @inproceedings{satuluri2011, author = {Satuluri, V. and Parthasarathy, S. and Ruan, Y.}, title = {Local graph sparsification for scalable clustering}, booktitle = {Proceedings of the ACM SIGMOD International Conference on Management of Data}, pages = {721--732}, year = {2011}, doi = {10.1145/1989323.1989399} } @misc{keegan_nx_backbone, author = {Keegan, Brian C.}, title = {nx-backbone: Backbone extraction algorithms for complex networks}, version = {...}, url = {https://github.com/brianckeegan/nx-backbone}, note = {Python package} }
Registry#
The registry is importable from nx_backbone.describe for
building reference lists; it is not part of the top-level namespace.
- nx_backbone.describe.ALIASES#
Other accepted names (short aliases and dispatch-wrapper method names).
- nx_backbone.describe.EXCLUDED#
Public names in the method modules that are deliberately not described.
- nx_backbone.describe.SCORE_KEYS#
Edge attribute that a cut on each static method’s output uses: a p-value (cut with
threshold_filter(..., mode="below")), another score (cut withmode="above") or a*_keepflag (boolean_filter).
- nx_backbone.describe.REFERENCES#
Bibliography of every method in
METHODSand every correction inadjust_pvalues(), keyed by BibTeX key.
- class nx_backbone.describe.Method(label, summary, refs=(), kind='weighted', test=False, builtin_mtc=None)[source]#
Bases:
objectRegistry entry for one backbone method.
- label
Name of the method as it reads in a sentence (“the disparity filter”).
- summary
Relative clause describing what the method scores and against which null model or criterion (“which tests …”).
- refs
Keys into
REFERENCES.- kind
Input the method takes:
"weighted","unweighted","bipartite"(agent-pair projection),"hypergraph"or"temporal"(snapshots, events or spans).- test
Whether the method yields p-values to compare with
alpha.- builtin_mtc
Correction the method applies itself (
"bh"for SVH/SVC), in which case mtc must stay"none".
- class nx_backbone.describe.Reference(key, kind, authors, year, title, venue='', volume='', number='', pages='', doi='', eprint='')[source]#
Bases:
objectA bibliography entry, rendered as an in-text citation, text or BibTeX.
kindis the BibTeX entry type ("article","inproceedings","book"or"misc");venueis the journal, proceedings or publisher.eprintis an arXiv identifier.- key#
- kind#
- authors#
- year#
- title#
- venue = ''#
- volume = ''#
- number = ''#
- pages = ''#
- doi = ''#
- eprint = ''#