networkanalysis.statistics#
This module contains classes and functions to compute statistics on networks.
Functions
|
Compute the geometrically weighted degree of the simple graph. |
|
Compute the geometrically weighted edgewise shared partners of the graph. |
|
Count the number of in k-stars of the directed graph. |
|
Count the number of k-stars of the undirected graph. |
|
Count the number of pairs of nodes in the graph that has a mutual connection. |
|
Count the number of out k-stars of the directed graph. |
|
Transform the list of statistics into one function that computes the vector of statistics from the list. |
Classes
|
|
Dummy callable object that mimics |
|
Dummy callable object that mimics |
|
Dummy callable object that mimics |
|
Dummy callable object that mimics |
|
Dummy callable object that mimics |
|
Dummy callable object that mimics |
|
Dummy callable object that mimics |
|
Callable object that computes a vector of statistics from a graph. |
- class networkanalysis.statistics.CachedStatsComp#
Bases:
StatsCompStatsCompthat caches the computed statistics.- __init__(stats, max_size=10000)#
Initialize the CachedStatsComp object.
- Parameters:
stats (list[ collections.abc.Callable[ [networkx.Graph | networkx.DiGraph], float | int] ] | StatsComp | CachedStatsComp) – List of callable object that takes a NetworkX graph as argument. It also accepts another StatsComp object or even a CachedStatsComp object and copy it.
max_size (int) – Maximum number of graphs to cache.
- class networkanalysis.statistics.InKStars#
Bases:
objectDummy callable object that mimics
in_kstars().- __init__(k)#
Initializa a callable object that mimics
in_kstars().- Parameters:
k (int) – The number of branch of a star.
- class networkanalysis.statistics.Mutuals#
Bases:
objectDummy callable object that mimics
mutuals().
- class networkanalysis.statistics.NEdges#
Bases:
objectDummy callable object that mimics
number_of_edges().
- class networkanalysis.statistics.OutKStars#
Bases:
objectDummy callable object that mimics
out_kstars().- __init__(k)#
Initializa a callable object that mimics
out_kstars().- Parameters:
k (int) – The number of branch of a star.
- class networkanalysis.statistics.StatsComp#
Bases:
objectCallable object that computes a vector of statistics from a graph. StatsComp can be understand as “Statistics Computer”.
- networkanalysis.statistics.gwd(graph, decay)#
Compute the geometrically weighted degree of the simple graph.
- networkanalysis.statistics.gwesp(graph, decay)#
Compute the geometrically weighted edgewise shared partners of the graph.
- networkanalysis.statistics.in_kstars(graph, k)#
Count the number of in k-stars of the directed graph. An in k-star in composed of arcs pointing towards its center.
- networkanalysis.statistics.kstars(graph, k)#
Count the number of k-stars of the undirected graph.
- networkanalysis.statistics.mutuals(graph)#
Count the number of pairs of nodes in the graph that has a mutual connection. In a undirected multigraph, two nodes have a mutual connection if there are at least two edges between them. In a directed graph, two arcs between two nodes must be of opposite direction for having a mutual connection.
- networkanalysis.statistics.out_kstars(graph, k)#
Count the number of out k-stars of the directed graph. An out k-star in composed of arcs pointing towards its border.
- networkanalysis.statistics.stats_transform(stats)#
Transform the list of statistics into one function that computes the vector of statistics from the list.
- Parameters:
stats (SeqGraph2Stats) – List of callable object that takes a NetworkX graph as argument.
- Returns:
A callable object that takes a NetworkX graph as argument and returns a vector of statistics.
- Return type:
collections.abc.Callable[ [networkx.Graph | networkx.DiGraph], numpy.ndarray]