rpasdt.algorithm package¶
Subpackages¶
- rpasdt.algorithm.source_detectors package
- Submodules
- rpasdt.algorithm.source_detectors.centrality module
- rpasdt.algorithm.source_detectors.common module
- rpasdt.algorithm.source_detectors.dynamic_age module
- rpasdt.algorithm.source_detectors.jordan_center module
- rpasdt.algorithm.source_detectors.net_sleuth module
- rpasdt.algorithm.source_detectors.rumour_center module
- rpasdt.algorithm.source_detectors.source_detection module
- Module contents
Submodules¶
rpasdt.algorithm.centralities module¶
Graph centrality measures.
- rpasdt.algorithm.centralities.compute_centrality(type: Union[str, rpasdt.algorithm.taxonomies.CentralityOptionEnum], graph: networkx.classes.graph.Graph, *args, **kwargs) Dict[int, float][source]¶
- rpasdt.algorithm.centralities.compute_unbiased_centrality(type: Union[str, rpasdt.algorithm.taxonomies.CentralityOptionEnum], r: float, graph: networkx.classes.graph.Graph, *args, **kwargs) Dict[int, float][source]¶
rpasdt.algorithm.communities module¶
Community detection methods.
- rpasdt.algorithm.communities.find_communities(type: Union[str, rpasdt.algorithm.taxonomies.CommunityOptionEnum], graph: networkx.classes.graph.Graph, number_communities: int = 1, **alg_kwargs) Dict[int, List[int]][source]¶
rpasdt.algorithm.diffusion module¶
Diffusion models configuration.
- rpasdt.algorithm.diffusion.get_and_init_diffusion_model(graph: networkx.classes.graph.Graph, diffusion_type: rpasdt.algorithm.taxonomies.DiffusionTypeEnum, source_nodes: List[int], model_params: Optional[Dict] = None)[source]¶
Create and initialize diffusion model based on provided config.
- rpasdt.algorithm.diffusion.get_diffusion_model_default_params(diffusion_model: <module 'ndlib.models.DiffusionModel' from '/home/docs/checkouts/readthedocs.org/user_builds/rpasdt/envs/stable/lib/python3.7/site-packages/ndlib/models/DiffusionModel.py'>) Dict[source]¶
Return default configuration for provided diffusion model.
- rpasdt.algorithm.diffusion.get_nodes_by_diffusion_status(diffusion_model: <module 'ndlib.models.DiffusionModel' from '/home/docs/checkouts/readthedocs.org/user_builds/rpasdt/envs/stable/lib/python3.7/site-packages/ndlib/models/DiffusionModel.py'> = None, node_status: rpasdt.algorithm.taxonomies.NodeStatusEnum = NodeStatusEnum.INFECTED) List[int][source]¶
Return nodes with required status.
rpasdt.algorithm.graph_drawing module¶
Graph drawing utilities.
- rpasdt.algorithm.graph_drawing.compute_graph_draw_position(graph: networkx.classes.graph.Graph, layout: Optional[rpasdt.algorithm.taxonomies.GraphLayout] = None, *args, **kwargs)[source]¶
- rpasdt.algorithm.graph_drawing.get_diffusion_graph(source_graph: networkx.classes.graph.Graph, infected_nodes: List[int], graph_node_rendering_type: rpasdt.algorithm.taxonomies.DiffusionGraphNodeRenderTypeEnum = DiffusionGraphNodeRenderTypeEnum.ONLY_INFECTED) networkx.classes.graph.Graph[source]¶
rpasdt.algorithm.graph_export_import module¶
Graph export/import utilities.
rpasdt.algorithm.graph_loader module¶
Graph loading utilities.
- rpasdt.algorithm.graph_loader.load_graph(graph_type: Union[rpasdt.algorithm.taxonomies.GraphTypeEnum, str], graph_type_properties: Optional[Dict] = None, *args, **kwargs) networkx.classes.graph.Graph[source]¶
rpasdt.algorithm.models module¶
rpasdt.algorithm.network_analysis module¶
Network analysis utilities.
- rpasdt.algorithm.network_analysis.compute_network_analysis(type: rpasdt.algorithm.taxonomies.NetworkAnalysisOptionEnum, graph: networkx.classes.graph.Graph)[source]¶
rpasdt.algorithm.plots module¶
rpasdt.algorithm.simulation module¶
rpasdt.algorithm.source_detection_evaluation module¶
rpasdt.algorithm.source_selection module¶
rpasdt.algorithm.taxonomies module¶
Algorithms taxonomies.
- class rpasdt.algorithm.taxonomies.CentralityOptionEnum(value)[source]¶
Bases:
rpasdt.common.enums.StringChoiceEnumAvailable centrality measures.
- BETWEENNESS = 'betweenness'¶
- CLOSENESS = 'closeness'¶
- DEGREE = 'degree'¶
- EDGE_BETWEENNESS = 'edge_betweenness'¶
- EIGENVECTOR = 'eigenvector'¶
- HARMONIC = 'harmonic'¶
- KATZ = 'katz'¶
- PAGE_RANK = 'PageRank'¶
- PERLOCATION = 'percolation'¶
- TROPHIC = 'Trophic'¶
- VOTE_RANK = 'Vote rank'¶
- class rpasdt.algorithm.taxonomies.ClusteringOptionEnum(value)[source]¶
Bases:
rpasdt.common.enums.StringChoiceEnumAn enumeration.
- K_CLIQUE = 'k_clique'¶
- K_CORE = 'k_core'¶
- K_CORONA = 'k_corona'¶
- K_CRUST = 'k_crust'¶
- K_MEANS = 'k_means'¶
- K_SHELL = 'k_shell'¶
- class rpasdt.algorithm.taxonomies.CommunityOptionEnum(value)[source]¶
Bases:
rpasdt.common.enums.StringChoiceEnumAvailable community detection methods.
- AGDL = 'agdl'¶
- ASYNC_FLUID = 'async_fluid'¶
- BELIEF = 'belief'¶
- CHINESEWHISPERS = 'chinesewhispers'¶
- CPM = 'cpm'¶
- DER = 'der'¶
- EDMOT = 'edmot'¶
- EIGENVECTOR = 'eigenvector'¶
- EM = 'em'¶
- GA = 'ga'¶
- GDMP2 = 'gdmp2'¶
- GEMSEC = 'gemsec'¶
- GIRVAN_NEWMAN = 'girvan_newman'¶
- GREEDY_MODULARITY = 'greedy_modularity'¶
- HEAD_TAIL = 'head_tail'¶
- INFOMAP = 'infomap'¶
- KCUT = 'kcut'¶
- LABEL_PROPAGATION = 'label_propagation'¶
- LEIDEN = 'leiden'¶
- LOUVAIN = 'louvain'¶
- LSWL = 'lswl'¶
- LSWL_PLUS = 'lswl_plus'¶
- MARKOV_CLUSTERING = 'markov_clustering'¶
- MCODE = 'mcode'¶
- MOD_M = 'mod_m'¶
- MOD_R = 'mod_r'¶
- PARIS = 'paris'¶
- PYCOMBO = 'pycombo'¶
- RBER_POTS = 'rber_pots'¶
- RB_POTS = 'rb_pots'¶
- RICCI_COMMUNITY = 'ricci_community'¶
- R_SPECTRAL_CLUSTERING = 'r_spectral_clustering'¶
- SBM_DL = 'sbm_dl'¶
- SBM_DL_NESTED = 'sbm_dl_nested'¶
- SCAN = 'scan'¶
- SCD = 'scd'¶
- SIGNIFICANCE_COMMUNITIES = 'significance_communities'¶
- SPECTRAL = 'spectral'¶
- SPINGLASS = 'spinglass'¶
- SURPRISE_COMMUNITIES = 'surprise_communities'¶
- THRESHOLD_CLUSTERING = 'threshold_clustering'¶
- WALKTRAP = 'walktrap'¶
- class rpasdt.algorithm.taxonomies.DiffusionGraphNodeRenderTypeEnum(value)[source]¶
Bases:
rpasdt.common.enums.StringChoiceEnumAvailable graph nodes rendering nodes.
- FULL = 'FULL'¶
- ONLY_INFECTED = 'ONLY_INFECTED'¶
- class rpasdt.algorithm.taxonomies.DiffusionSimulationMode(value)[source]¶
Bases:
rpasdt.common.enums.StringChoiceEnumAvailable diffusion simulation modes.
- BUNCH = 'BUNCH'¶
- SINGLE = 'SINGLE'¶
- TO_FULL_COVER = 'TO_FULL_COVER'¶
- class rpasdt.algorithm.taxonomies.DiffusionTypeEnum(value)[source]¶
Bases:
rpasdt.common.enums.StringChoiceEnumAvailable diffusion models.
- GENERALISED_THRESHOLD = 'GENERALISED_THRESHOLD'¶
- INDEPENDENT_CASCADES = 'INDEPENDENT_CASCADES'¶
- KERTESZ_THRESHOLD = 'KERTESZ_THRESHOLD'¶
- MAJORITY_RULE = 'MAJORITY_RULE'¶
- Q_VOTER = 'Q_VOTER'¶
- SEIR = 'SEIR'¶
- SI = 'SI'¶
- SIR = 'SIR'¶
- SIS = 'SIS'¶
- SWIR = 'SWIR'¶
- SZNAJD = 'SZNAJD'¶
- THRESHOLD = 'THRESHOLD'¶
- VOTER = 'VOTER'¶
- class rpasdt.algorithm.taxonomies.GraphDataFormatEnum(value)[source]¶
Bases:
rpasdt.common.enums.StringChoiceEnumAn enumeration.
- MULTILINE_ADJLIST = 'MULTILINE_ADJLIST'¶
- class rpasdt.algorithm.taxonomies.GraphLayout(value)[source]¶
Bases:
rpasdt.common.enums.StringChoiceEnumAvailable graph rendering layouts.
- CIRCULAR = 'CIRCULAR'¶
- KAMADA_KAWAI = 'KAMADA_KAWAI'¶
- PLANAR = 'PLANAR'¶
- RANDOM = 'RANDOM'¶
- SHELL = 'SHELL'¶
- SPECTRAL = 'SPECTRAL'¶
- SPRING = 'SPRING'¶
- class rpasdt.algorithm.taxonomies.GraphTypeEnum(value)[source]¶
Bases:
rpasdt.common.enums.StringChoiceEnumAvailable graph types and predefined topologies.
- BALANCED_TREE = 'BALANCED_TREE'¶
- BARABASI_ALBERT = 'BARABASI_ALBERT'¶
- CAVEMAN_GRAPH = 'CAVEMAN_GRAPH'¶
- COMPLETE = 'COMPLETE'¶
- CONNECTED_CAVEMAN_GRAPH = 'CONNECTED_CAVEMAN_GRAPH'¶
- CUSTOM = 'CUSTOM'¶
- DAVIS_SOUTHERN = 'DAVIS_SOUTHERN'¶
- ERDOS_RENYI = 'ERDOS_RENYI'¶
- FLORENTINE_FAMILIES = 'FLORENTINE_FAMILIES'¶
- KARATE_CLUB = 'KARATE_CLUB'¶
- LES_MISERABLES = 'LES_MISERABLES'¶
- STAR = 'STAR'¶
- WATTS_STROGATZ = 'WATTS_STROGATZ'¶
- class rpasdt.algorithm.taxonomies.NetworkAnalysisOptionEnum(value)[source]¶
Bases:
rpasdt.common.enums.StringChoiceEnumAvailable network analysis measures.
- AVERAGE_CLUSTERING = 'average_clustering'¶
- DENSITY = 'density'¶
- SUMMARY = 'summary'¶
- class rpasdt.algorithm.taxonomies.NodeStatusEnum(value)[source]¶
Bases:
rpasdt.common.enums.StringChoiceEnumAvailable node statuses.
- BLOCKED = 'Blocked'¶
- INFECTED = 'Infected'¶
- RECOVERED = 'Recovered'¶
- SUSCEPTIBLE = 'Susceptible'¶
- class rpasdt.algorithm.taxonomies.SourceDetectionAlgorithm(value)[source]¶
Bases:
rpasdt.common.enums.StringChoiceEnumAvailable source detection methods.
- CENTRALITY_BASED = 'centrality'¶
- COMMUNITY_CENTRALITY_BASED = 'community_centrality'¶
- COMMUNITY_UNBIASED_CENTRALITY_BASED = 'community_unbiased_centrality'¶
- DYNAMIC_AGE = 'dynamic_age'¶
- JORDAN_CENTER = 'jordan_center'¶
- MULTIPLE_CENTRALITY_BASED = 'multiple_centrality'¶
- NET_SLEUTH = 'net_sleuth'¶
- RUMOR_CENTER = 'rumor_center'¶
- UNBIASED_CENTRALITY_BASED = 'unbiased_centrality'¶
rpasdt.algorithm.utils module¶
Module contents¶
Algorithms module.