probinet.synthetic.base#
Base classes for synthetic network generation.
Functions
|
Compute the KxK affinity matrix w with probabilities between and within groups. |
Classes
|
A base abstract class for generation and management of synthetic networks. |
Mixin class for graph processing and evaluation methods. |
|
|
Create a synthetic, directed, and weighted network (possibly multilayer) by a standard mixed-membership stochastic block-models. |
|
- class probinet.synthetic.base.BaseSyntheticNetwork(N: int = 1000, L: int = 1, K: int = 2, seed: int = 10, eta: float = 50, out_folder: PathLike | None = None, output_parameters: bool = False, output_adj: bool = False, outfile_adj: str | None = None, end_file: str | None = None, show_details: bool = True, show_plots: bool = False, **kwargs)[source]#
A base abstract class for generation and management of synthetic networks.
Suitable for representing any type of synthetic network.
- class probinet.synthetic.base.GraphProcessingMixin[source]#
Mixin class for graph processing and evaluation methods.
- class probinet.synthetic.base.StandardMMSBM(**kwargs)[source]#
Create a synthetic, directed, and weighted network (possibly multilayer) by a standard mixed-membership stochastic block-models.
It models marginals (iid assumption) with Poisson distributions
- class probinet.synthetic.base.Structure(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
- ASSORTATIVE = 'assortative'#
- CORE_PERIPHERY = 'core-periphery'#
- DIRECTED_BIASED = 'directed-biased'#
- DISASSORTATIVE = 'disassortative'#
- probinet.synthetic.base.affinity_matrix(structure: Structure | str = 'assortative', N: int = 100, K: int = 2, avg_degree: float = 4.0, a: float = 0.1, b: float = 0.3) ndarray [source]#
Compute the KxK affinity matrix w with probabilities between and within groups.
- Parameters:
structure (Structure, optional) – Structure of the network (default is Structure.ASSORTATIVE).
N (int, optional) – Number of nodes (default is 100).
K (int, optional) – Number of communities (default is 2).
avg_degree (float, optional) – Average degree of the network (default is 4.0).
a (float, optional) – Parameter for secondary probabilities (default is 0.1).
b (float, optional) – Parameter for secondary probabilities in ‘core-periphery’ and ‘directed-biased’ structures (default is 0.3).
- Returns:
KxK affinity matrix. Element (k,h) gives the density of edges going from the nodes of group k to nodes of group h.
- Return type:
np.ndarray