-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c282471
commit ddb0f85
Showing
17 changed files
with
229 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,18 @@ | ||
import networkx as nx | ||
import netcenlib as ncl | ||
|
||
from nsdlib.common.models import SourceDetectionConfig | ||
from nsdlib.source_detection import SourceDetector | ||
from nsdlib.taxonomies import OutbreaksDetectionAlgorithm, \ | ||
NodeEvaluationAlgorithm | ||
from nsdlib.taxonomies import NodeEvaluationAlgorithm | ||
|
||
# Create a graph | ||
G = nx.karate_club_graph() | ||
|
||
config = SourceDetectionConfig( | ||
selection_threshold=None, | ||
node_evaluation_algorithm=NodeEvaluationAlgorithm.NETSLEUTH, | ||
) | ||
|
||
source_detector = SourceDetector(config) | ||
|
||
result, evaluation = source_detector.detect_sources_and_evaluate(G=G, | ||
IG=G, real_sources=[0,33]) | ||
result, evaluation = source_detector.detect_sources_and_evaluate( | ||
G=G, IG=G, real_sources=[0, 33] | ||
) | ||
print(result.global_scores) | ||
print(ncl.degree_centrality(G)) | ||
|
||
print(evaluation) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
# flake8: noq | ||
|
||
from nsdlib.algorithms.outbreaks_detection import ( | ||
CPM_Bipartite as outbreaks_detection_CPM_Bipartite, | ||
agdl as outbreaks_detection_agdl, | ||
angel as outbreaks_detection_angel, | ||
aslpaw as outbreaks_detection_aslpaw, | ||
async_fluid as outbreaks_detection_async_fluid, | ||
attribute_clustering as outbreaks_detection_attribute_clustering, | ||
bayan as outbreaks_detection_bayan, | ||
belief as outbreaks_detection_belief, | ||
bimlpa as outbreaks_detection_bimlpa, | ||
bipartite_clustering as outbreaks_detection_bipartite_clustering, | ||
coach as outbreaks_detection_coach, | ||
condor as outbreaks_detection_condor, | ||
conga as outbreaks_detection_conga, | ||
congo as outbreaks_detection_congo, | ||
core_expansion as outbreaks_detection_core_expansion, | ||
cpm as outbreaks_detection_cpm, | ||
crisp_partition as outbreaks_detection_crisp_partition, | ||
dcs as outbreaks_detection_dcs, | ||
demon as outbreaks_detection_demon, | ||
der as outbreaks_detection_der, | ||
dpclus as outbreaks_detection_dpclus, | ||
ebgc as outbreaks_detection_ebgc, | ||
edge_clustering as outbreaks_detection_edge_clustering, | ||
ego_networks as outbreaks_detection_ego_networks, | ||
eigenvector as outbreaks_detection_eigenvector, | ||
em as outbreaks_detection_em, | ||
endntm as outbreaks_detection_endntm, | ||
eva as outbreaks_detection_eva, | ||
frc_fgsn as outbreaks_detection_frc_fgsn, | ||
ga as outbreaks_detection_ga, | ||
gdmp2 as outbreaks_detection_gdmp2, | ||
girvan_newman as outbreaks_detection_girvan_newman, | ||
graph_entropy as outbreaks_detection_graph_entropy, | ||
greedy_modularity as outbreaks_detection_greedy_modularity, | ||
head_tail as outbreaks_detection_head_tail, | ||
hierarchical_link_community as outbreaks_detection_hierarchical_link_community, | ||
ilouvain as outbreaks_detection_ilouvain, | ||
infomap as outbreaks_detection_infomap, | ||
infomap_bipartite as outbreaks_detection_infomap_bipartite, | ||
internal as outbreaks_detection_internal, | ||
internal_dcd as outbreaks_detection_internal_dcd, | ||
ipca as outbreaks_detection_ipca, | ||
kclique as outbreaks_detection_kclique, | ||
kcut as outbreaks_detection_kcut, | ||
label_propagation as outbreaks_detection_label_propagation, | ||
lais2 as outbreaks_detection_lais2, | ||
leiden as outbreaks_detection_leiden, | ||
lemon as outbreaks_detection_lemon, | ||
lfm as outbreaks_detection_lfm, | ||
louvain as outbreaks_detection_louvain, | ||
lpam as outbreaks_detection_lpam, | ||
lpanni as outbreaks_detection_lpanni, | ||
lswl as outbreaks_detection_lswl, | ||
lswl_plus as outbreaks_detection_lswl_plus, | ||
markov_clustering as outbreaks_detection_markov_clustering, | ||
mcode as outbreaks_detection_mcode, | ||
mod_m as outbreaks_detection_mod_m, | ||
mod_r as outbreaks_detection_mod_r, | ||
multicom as outbreaks_detection_multicom, | ||
node_perception as outbreaks_detection_node_perception, | ||
overlapping_partition as outbreaks_detection_overlapping_partition, | ||
overlapping_seed_set_expansion as outbreaks_detection_overlapping_seed_set_expansion, | ||
paris as outbreaks_detection_paris, | ||
percomvc as outbreaks_detection_percomvc, | ||
principled_clustering as outbreaks_detection_principled_clustering, | ||
pycombo as outbreaks_detection_pycombo, | ||
r_spectral_clustering as outbreaks_detection_r_spectral_clustering, | ||
rb_pots as outbreaks_detection_rb_pots, | ||
rber_pots as outbreaks_detection_rber_pots, | ||
ricci_community as outbreaks_detection_ricci_community, | ||
sbm_dl as outbreaks_detection_sbm_dl, | ||
sbm_dl_nested as outbreaks_detection_sbm_dl_nested, | ||
scan as outbreaks_detection_scan, | ||
siblinarity_antichain as outbreaks_detection_siblinarity_antichain, | ||
significance_communities as outbreaks_detection_significance_communities, | ||
slpa as outbreaks_detection_slpa, | ||
spectral as outbreaks_detection_spectral, | ||
spinglass as outbreaks_detection_spinglass, | ||
surprise_communities as outbreaks_detection_surprise_communities, | ||
temporal_partition as outbreaks_detection_temporal_partition, | ||
threshold_clustering as outbreaks_detection_threshold_clustering, | ||
tiles as outbreaks_detection_tiles, | ||
umstmo as outbreaks_detection_umstmo, | ||
walkscan as outbreaks_detection_walkscan, | ||
walktrap as outbreaks_detection_walktrap, | ||
wCommunity as outbreaks_detection_wCommunity, | ||
) | ||
from nsdlib.algorithms.reconstruction import sbrp as reconstruction_sbrp |
Oops, something went wrong.