AlloViz.AlloViz.Filtering.Filtering.analyze¶
- Filtering.analyze(elements='edges', metrics='all', cores=1, nodes_dict={'btw': 'networkx.algorithms.centrality.betweenness_centrality', 'cfb': 'networkx.algorithms.centrality.current_flow_betweenness_centrality'}, edges_dict={'btw': 'networkx.algorithms.centrality.edge_betweenness_centrality', 'cfb': 'networkx.algorithms.centrality.edge_current_flow_betweenness_centrality'}, **kwargs)[source]¶
Analyze the filtered network
Send the analyses of the filtered network for the passed combinations of elements-metrics. The individual Graphs saved as private attributes upon object initialization are analyzed independently with the
Analysis
module (this function callsAlloViz.AlloViz.Analysis.analyze()
). Results are stored as new instances of classes from theAlloViz.AlloViz.Elements
module, which extend thepandas.DataFrame
class.- Parameters:
- elementsstr or list, {“edges”, “nodes”}
Network element for which to perform the analysis.
- metricsstr or list, default: “all”
Network metrics to compute, which must be keys in the nodes_dict or edges_dict dictionaries. Default is “all” and it sends the computation for all the metrics defined in the corresponding dictionary of the selected elements in element.
- coresint, default: 1
Number of cores to use for parallelization with a multiprocess Pool. Default value only uses 1 core with a custom
AlloViz.utils.dummypool
that performs computations synchronously.
- Other Parameters:
- nodes_dict, edges_dictdict
Optional kwarg(s) of the dictionary(ies) that maps network metrics custom names (e.g., betweenness centrality, “btw”) with their corresponding NetworkX function (e.g., “networkx.algorithms.centrality.betweenness_centrality”). Functions strings must be written as if they were absolute imports, and must return a dictionary of edges or nodes, depending on the element dictionary in which they are. The keys of the dictionaries will be used to name the columns of the analyzed data that the functions produce. Defaults are
nodes_dict
andedges_dict
.- **kwargs
Other optional keyword arguments that will be passed to the NetworkX analysis function(s) that is(are) used on the method call in case they need extra parameters.