Skip to content

Latest commit

 

History

History

scripts

How to use it

SDPASS model

The following commands compute and save the anomaly fraction for the SDPASS model

$ conda activate anomaly 
$ python model_network.py

model_network.py will generate the follwing files:

../spatial_model/UBCM_ksb_{}_{}_{}_{}_{}_{}.txt - contains the degree, strength, and betweeness
../spatial_model/UECM_ksb_{}_{}_{}_{}_{}_{}.txt'- contains the degree, strength, and betweeness ../spatial_model/{}_{}_{}_{}_{}_{}.txt - contains the degree and strength sequences to be used to generate the ensemble.

Generating ensemble using the matlab script:

MATLAB >> SaveSpatialModelSamples('network_name.txt',1000) 

Then, run model_betweenness.py to compute the degree, strength, and betweeness of each sample of the ensemble and model_anomaly_fraction.py computes the fraction of anomalies.

$ conda activate anomaly 
$ python model_betweenness.py
$ python model_anomaly_fraction.py

Computing and saving betweenness centrality of real data set

The following commands compute and save the betweenness centrality for the real dataset

$ conda activate anomaly 
$ python betweenness.py