DYMOND.learning package

Submodules

DYMOND.learning.learn_parameters module

DYMOND.learning.learn_parameters.calc_motifs_timesteps(motif_types, g, timesteps, tmp_files_dir)[source]

Calculate timesteps each motif appears in

Parameters
  • motif_types (dict) – motif types

  • g (igraph.Graph) – input graph

  • timesteps (int) – graph timesteps

  • tmp_files_dir (str) – directory for tmp files

DYMOND.learning.learn_parameters.get_active_nodes(g, timesteps, tmp_files_dir)[source]

Get active nodes in each timestep

Parameters
  • g (igraph.Graph) – input graph

  • timesteps (int) – graph timesteps

  • tmp_files_dir (str) – directory for tmp files

Returns

active nodes per timestep

Return type

dict

DYMOND.learning.learn_parameters.get_dataset(dataset_dir)[source]

Get dataset directory, info, and graph.

Parameters

dataset_dir (str) – dataset directory

Returns

dataset directory, info, and graph

Return type

str, dict, igraph.Graph

DYMOND.learning.learn_parameters.get_directories_parameters(dataset_dir)[source]

Get the directories for parameters and temp save files. If they don’t exist, create the directories.

Parameters

dataset_dir (str) – dataset directory

Returns

parameters directory, tmp files directory

Return type

str, str

DYMOND.learning.learn_parameters.get_motif_counts(motifs, motif_types, g, timesteps, tmp_files_dir)[source]

Estimate motif edge-weighted counts

Parameters
  • motifs (list) – motifs

  • motif_types (dict) – motif types

  • g (igraph.Graph) – input graph

  • timesteps (int) – graph timesteps

  • tmp_files_dir (str) – directory for tmp files

Returns

motif edge-weighted counts and num. of timesteps

DYMOND.learning.learn_parameters.get_motifs_graph(g, timesteps, tmp_files_dir, nodes=None)[source]

Get the motifs in the input graph

Parameters
  • g (igraph.Graph) – input graph

  • timesteps (int) – graph timesteps

  • tmp_files_dir (str) – directory for tmp files

  • nodes (list) – (optional) nodes to get motifs for

Returns

motifs and motif types

Return type

dict

DYMOND.learning.learn_parameters.get_motifs_t(t, tmp_files_dir)[source]

Get motifs in timestep t

Parameters
  • t (int) – timestep

  • tmp_files_dir (str) – directory for tmp files

Returns

motifs at time t

Return type

dict

DYMOND.learning.learn_parameters.get_node_role_counts(g, timesteps, tmp_files_dir)[source]

Estimate node role counts

Parameters
  • g (igraph.Graph) – input graph

  • timesteps (int) – graph timesteps

  • tmp_files_dir (str) – directory for tmp files

Returns

node role counts, motif type counts

Return type

dict, dict

DYMOND.learning.learn_parameters.learn_motif_interarrival_rates(motifs, motif_types, g, timesteps, tmp_files_dir)[source]

Estimate inter-arrival rates per motif type

Parameters
  • motifs (list) – motifs

  • motif_types (dict) – motif types

  • g (igraph.Graph) – input graph

  • timesteps (int) – graph timesteps

  • tmp_files_dir (str) – directory for tmp files

Returns

motif interarrival rates

Return type

dict

DYMOND.learning.learn_parameters.learn_motif_proportions(motifs, motif_types, size_V, tmp_files_dir)[source]

Estimate proportions of each motif type

Parameters
  • motifs (list) – motifs

  • motif_types (dict) – motif types

  • size_V (int) – number of nodes

  • tmp_files_dir

Returns

motif type proportions

Return type

dict

DYMOND.learning.learn_parameters.learn_node_arrival_rates(g, timesteps, tmp_files_dir)[source]

Estimate node arrival rates

Parameters
  • g (igraph.Graph) – input graph

  • timesteps (int) – graph timesteps

  • tmp_files_dir (str) – directory for tmp files

Returns

node arrival rate

Return type

dict

DYMOND.learning.learn_parameters.learn_node_roles_distribution(g, timesteps, tmp_files_dir)[source]

Estimate node role probabilities

Parameters
  • g (igraph.Graph) – input graph

  • timesteps (int) – graph timesteps

  • tmp_files_dir (str) – directory for tmp files

Returns

node role probabilities, role counts, motif type counts

Return type

dict, dict, dict

DYMOND.learning.learn_parameters.learn_parameters(dataset_dir, dataset_info, g)[source]

Learn parameters from input graph

Parameters
  • dataset_dir (str) – dataset directory

  • dataset_info (dict) – dataset information

  • g (igraph.Graph) – dataset graph

Module contents