AlloViz.AlloViz.Filtering.Filtering.analyze¶
- Filtering.analyze(elements='edges', metrics='all', cores=1, nodes_dict={'btw': {'arguments': {'seed': 0, 'weight': 'graph_distance'}, 'function': 'networkx.algorithms.centrality.betweenness_centrality'}, 'cfb': {'arguments': {'weight': 'graph_weight'}, 'function': 'networkx.algorithms.centrality.current_flow_betweenness_centrality'}}, edges_dict={'btw': {'arguments': {'seed': 0, 'weight': 'graph_distance'}, 'function': 'networkx.algorithms.centrality.edge_betweenness_centrality'}, 'cfb': {'arguments': {'weight': 'graph_weight'}, 'function': 'networkx.algorithms.centrality.edge_current_flow_betweenness_centrality'}})[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
Analysismodule (this function callsAlloViz.AlloViz.Analysis.analyze()). Results are stored as new instances of classes from theAlloViz.AlloViz.Elementsmodule, which extend thepandas.DataFrameclass.- 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.dummypoolthat 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 and arguments, with the format: ```
- {
- “btw”: {
“function”: “networkx.algorithms.centrality.betweenness_centrality”, “arguments”: {“weight”: “graph_distance”, “seed”: 0}
}
}
``` 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_dictandedges_dict.