hatvis.models#

Random hypergraphs and null models.

Null models separate structure from chance: a pattern is interesting only if it is rarer or more frequent than in random hypergraphs that share some basic properties with the data (sizes, degrees, communities).

Uniform, size-preserving, Chung-Lu, configuration model, planted partition, temporal.

Functions#

uniform_random(n, m, k[, random_state, nodes])

Uniform random hypergraph: m hyperedges, each a uniformly random k-subset of n vertices.

random_hypergraph(n, sizes[, random_state, ...])

Random hypergraph with a prescribed size sequence (each hyperedge a uniform random subset).

chung_lu(degrees, sizes[, random_state])

Chung–Lu hypergraph: vertices enter a hyperedge with probability proportional to their degree.

configuration_model(H[, n_steps, random_state])

Degree- and size-preserving randomization by pairwise reshuffles (Chodrow 2020).

planted_partition(n, n_communities, m[, ...])

Hypergraph stochastic block model with planted communities.

temporal_random(n, m_per_step, n_steps[, ...])

Temporal hypergraph with tunable persistence: a fraction of the hyperedges is repeated from the last step.