flowstab.scripts.run_clusterings

Clusters the covariance integrals computed with run_cov_integrals.py (step 2). The clusterings are computed with the Louvain algorithm for each file containing the result of step 2 in {savedir}. The Louvain algorithm is repeated num_repeat times and the best partition (maximizing the flow stability) is selected. The ensemble of partitions is used to compute the variation of information. The computations for the different files is spread of nproc_files in parallel. It is also possible to parallelize the repeated clusterings using nproc_clustering. This requires nproc_files*nproc_clustering cores.

A number of metadata (e.g. all the parameters used to run the code) is saved together with the results in a dictionary.

The results of the clustering are saved with the following keys: - ‘clust_counter’ : All the different partitions found at each run of the Louvain algorithm togheter with the number of times they appeared. - ‘stabilites’ : All the values of the flow stability for each run. - ‘seeds’ : Random seeds for each run. - ‘nvarinf’ : Average normalized variation of information computed over the ensemble of partitions. - ‘avg_stab’: Average flow stability computed over the ensemble of partitions. - ‘avg_nclust’ : Average number of clusters computed over the ensemble of partitions. - ‘best_cluster’ : Best partition (the one with the max flow stability from the ensemble). - ‘best_stab’ : Flow stability value of the best partition.

The results are saved in files named f’{savedir}/clusters_{netname}_tau_w{tau_w:.3e}_PT_{int_start:06d}_to_{int_stop:06d}.pickle’

Attributes

ap

clust_verbose

compute_clustering

compute_nvarinf

compute_static_clustering

datadir

direction

files

files

inargs

init_p1

integral_rtol

max_num_varinf_samples

n_meta_iter_max

n_sub_iter_max

net_name

normalize_cov_mat

nproc_clustering

nproc_files

num_norm_iter

num_repeat

num_varinf_samples

num_varinf_samples

only_largest_comp

optional

print_num_loops

required

save_clustering_before_nvarinf

savedir

separate_comps

var_dict

verbose

Functions

compute_nvi_sample(params)

compute_static_clustering_fct(params)

load_autocov_int(file[, init_p1, direction])

main()

n_random_seeds(n)

worker(file_args)

Module Contents

flowstab.scripts.run_clusterings.compute_nvi_sample(params)[source]
flowstab.scripts.run_clusterings.compute_static_clustering_fct(params)[source]
flowstab.scripts.run_clusterings.load_autocov_int(file, init_p1=False, direction=None)[source]
flowstab.scripts.run_clusterings.main()[source]
flowstab.scripts.run_clusterings.n_random_seeds(n)[source]
flowstab.scripts.run_clusterings.worker(file_args)[source]
flowstab.scripts.run_clusterings.ap[source]
flowstab.scripts.run_clusterings.clust_verbose[source]
flowstab.scripts.run_clusterings.compute_clustering[source]
flowstab.scripts.run_clusterings.compute_nvarinf[source]
flowstab.scripts.run_clusterings.compute_static_clustering[source]
flowstab.scripts.run_clusterings.datadir[source]
flowstab.scripts.run_clusterings.direction[source]
flowstab.scripts.run_clusterings.files[source]
flowstab.scripts.run_clusterings.files[source]
flowstab.scripts.run_clusterings.inargs[source]
flowstab.scripts.run_clusterings.init_p1[source]
flowstab.scripts.run_clusterings.integral_rtol[source]
flowstab.scripts.run_clusterings.max_num_varinf_samples[source]
flowstab.scripts.run_clusterings.n_meta_iter_max[source]
flowstab.scripts.run_clusterings.n_sub_iter_max[source]
flowstab.scripts.run_clusterings.net_name[source]
flowstab.scripts.run_clusterings.normalize_cov_mat[source]
flowstab.scripts.run_clusterings.nproc_clustering[source]
flowstab.scripts.run_clusterings.nproc_files[source]
flowstab.scripts.run_clusterings.num_norm_iter[source]
flowstab.scripts.run_clusterings.num_repeat[source]
flowstab.scripts.run_clusterings.num_varinf_samples[source]
flowstab.scripts.run_clusterings.num_varinf_samples[source]
flowstab.scripts.run_clusterings.only_largest_comp[source]
flowstab.scripts.run_clusterings.optional[source]
flowstab.scripts.run_clusterings.print_num_loops[source]
flowstab.scripts.run_clusterings.required[source]
flowstab.scripts.run_clusterings.save_clustering_before_nvarinf[source]
flowstab.scripts.run_clusterings.savedir[source]
flowstab.scripts.run_clusterings.separate_comps[source]
flowstab.scripts.run_clusterings.var_dict[source]
flowstab.scripts.run_clusterings.verbose[source]