Collection of networks#
The library provides a basic set of networks which can be read directly. Also it contains a generator of multilayer networks according to Erdos=Renyi and Preferential attachement models.
Networks shipped with the library#
A toy network used with by the authors of CIM method.
- get_toy_network_cim() MultilayerNetwork#
Get a toy network that was used by the authors of CIM method.
The paper is here: https://doi.org/10.1007/s10489-021-02656-0
A three-layered network with 11 actors made up by Piotr.
- get_toy_network_piotr() MultilayerNetwork#
Get threelayered toy network easy to visualise.
Loader of the l2_course_net network.
- get_l2_course_net(node_features: bool, edge_features: bool, directed: bool) TemporalNetwork#
Read l2_course_net.
A network built from interactions between students during the three months long, abroad language course of the Arabic untertaken by 41 US students. This funciton loads a TemporalNetwork with three snapshots, each with two layers: “ego” (with edges picked as top 5 peers by each student) and “course” (with edges obtained by filtering out a complete graph according to a monthly questionarre).
For details see a paper which analyses the network: “Peer Interaction Dynamics and Second Language Learning Trajectories During Study Abroad: A Longitudinal Investigation Using Dynamic Computational Social Network Analysis” by M.B. Paradowski, N. Whitby, M. Czuba, and P. Bródka in “Language Learning”, 2024 (https://doi.org/10.1111/lang.12681). Please note that the networ used in paper was slightly different constructed: (1) it was a singlelayer network, (2) nodes 11 and 17 were discarded due to uncertainity of their data, (3) sources were not anonymised.
- Parameters:
node_features – wether to to load features of the nodes (mainly language profficiency and psychological metrics with personal data).
edge_features – wether to load features of the edges (intensity of contact and usage of the second language)
directed – wether to load the network as a directed graph; if so nummerical attributes of edges between corresponding nodes are averaged while other attributes are discarded
- Returns:
a temporal, multilayer network
Generators of artificial networks#
- class MultilayerERGenerator(nb_layers: int, nb_actors: int, nb_steps: int, std_nodes: int)#
Bases:
MultilayerBaseGeneratorErdos-Renyi multilayer networks generator.
- __init__(nb_layers: int, nb_actors: int, nb_steps: int, std_nodes: int) None#
Initialise the object.
- Parameters:
nb_layers – number of layers of the generated network
nb_actors – number of actors in the network
nb_steps – number of steps of the generative algorithm which builds the network
std_nodes – standard deviation of the number of nodes in each layer (expected value is a number of actors)
- get_models() list[PyEvolutionModel]#
Get the the evolutionary model.
For each layer with num nodes drawn from a standard distribution.
- Returns:
list of Erdos-Renyi generators
- class MultilayerPAGenerator(nb_layers: int, nb_actors: int, nb_steps: int, nb_hubs: int)#
Bases:
MultilayerBaseGeneratorPreferential Attachment multilayer networks generator.
- __init__(nb_layers: int, nb_actors: int, nb_steps: int, nb_hubs: int) None#
Initialise the object.
- Parameters:
nb_layers – number of layers of the generated network
nb_actors – number of actors in the network
nb_steps – number of steps of the generative algorithm which builds the network
nb_seeds – number of seeds in each layer and a number of egdes from each new vertex
- get_models() list[PyEvolutionModel]#
Get evolutionary models for each layer.
- Returns:
list of Preferential Attachment generators
- generate(model: Literal['PA', 'ER'], nb_actors: int, nb_layers: int) MultilayerNetwork#
Generate a multilayer Erdos-Renyi or Preferential-Attachement net.