Utils¶
Summary¶
The utils module provides various utility functions for working with ASH models, including matrix transformations, projections, and profile manipulations.
Matrices¶
Returns a mapping of hyperedge IDs to indices and vice versa. |
|
Returns a mapping of node IDs to indices and vice versa. |
|
Returns the incidence matrix of the ASH object. |
|
Returns a dictionary of incidence matrices for each time step in the ASH object. |
|
Returns the adjacency matrix of the ASH object. |
|
Returns a dictionary of adjacency matrices for each time step in the ASH object. |
Projections¶
Returns a NetworkX Graph object that is the clique projection of the given ASH object. |
|
Returns a NetworkX Graph object that is the bipartite projection of the given ASH object. |
|
Returns a NetworkX Graph object that is the line graph projection of the given ASH object. |
|
The dual_hypergraph function takes a hypergraph and returns the dual of that hypergraph. |
|
Returns a dictionary of NetworkX Graph objects that are the clique projections of the given ASH object for each time step. |
|
Returns a dictionary of NetworkX Graph objects that are the bipartite projections of the given ASH object for each time step. |
|
Returns a dictionary of NetworkX Graph objects that are the line graph projections of the given ASH object for each time step. |
|
Returns a dictionary of dual hypergraphs for each time step in the ASH object. |
Networkx Utils¶
Convert an undirected NetworkX Graph into an ASH with 2-node hyperedges. |
|
Convert a sequence of NetworkX Graphs into a time-sliced ASH. |
|
Convert maximal cliques of a NetworkX Graph into an ASH. |
|
Convert maximal cliques across time from a list of NetworkX Graphs into an ASH. |
|
Convert a bipartite NetworkX Graph into an ASH where one node set becomes hyperedges and the other set becomes nodes. |
|
Timesliced conversion of bipartite graphs into an ASH. |
Profile Utils¶
Returns an aggregated profile of a node over all time points. |
|
Returns the most frequent value of a node attribute in a hyperedge. |
|
Returns an aggregated profile of the nodes in a hyperedge. |