示例#1
0
 def _run_stochastic_block_model(self,
                                 write=False,
                                 write_property=None,
                                 **kwargs):
     raise CommunityDetector.PartitionError(
         "Stochastic block model is not implemented "
         "for Neo4j-based graphs")
示例#2
0
 def _run_girvan_newman(self,
                        weight=None,
                        n_communitites=2,
                        intermediate=False):
     raise CommunityDetector.PartitionError(
         "Girvan-Newman algorithm is not implemented "
         "for Neo4j-based graphs")
示例#3
0
 def detect_communities(self,
                        strategy="louvain",
                        weight=None,
                        n_communities=2,
                        intermediate=False,
                        write=False,
                        write_property=None,
                        **kwargs):
     """Detect community partition using the input strategy."""
     if strategy not in CommunityDetector._strategies.keys():
         raise CommunityDetector.PartitionError(
             f"Unknown community detection strategy '{strategy}'")
     partition = getattr(self, CommunityDetector._strategies[strategy])(
         weight=weight,
         n_communities=n_communities,
         intermediate=intermediate,
         write=write,
         write_property=write_property,
         **kwargs)
     return partition
示例#4
0
 def _run_stochastic_block_model(self, **kwargs):
     raise CommunityDetector.PartitionError(
         "Stochastic block model is not implemented "
         "for NetworkX-based graphs")
示例#5
0
 def _run_label_propagation(self, **kwargs):
     raise CommunityDetector.PartitionError(
         "Label propagation algorithm is not implemented "
         "for Neo4j-based graphs")
示例#6
0
 def _run_louvain(self, **kwargs):
     raise CommunityDetector.PartitionError(
         "Louvain algorithm is not implemented "
         "for graph-tool-based graphs")