ash_model.measures.inclusiveness¶
- ash_model.measures.inclusiveness(h, start=None, end=None)[source]¶
Computes the inclusiveness of the hypergraph over [start, end], defined as:
(# of non-facet hyperedges) / (total # of hyperedges)
A facet hyperedge is one that is not a subset of any other hyperedge. Non-facet hyperedges are those that are contained in at least one strictly larger hyperedge.
- Parameters:
- Returns:
a float in [0,1], or 0.0 if there are no hyperedges
- Return type:
Examples
>>> import numpy as np, networkx as nx >>> from ash_model.utils.networkx import from_networkx_maximal_cliques_list >>> Gs = [nx.barabasi_albert_graph(100, 3, seed=i) for i in range(10)] >>> rng = np.random.default_rng(42) >>> for G in Gs: ... for n in G.nodes(): ... G.nodes[n]['color'] = 'red' if rng.integers(0, 2) == 0 else 'blue' >>> h = from_networkx_maximal_cliques_list(Gs) >>> inclusiveness(h, start=0, end=0) 0.0