diff --git a/hcga/features/jaccard_similarity.py b/hcga/features/jaccard_similarity.py index b75b53ef..e377e393 100755 --- a/hcga/features/jaccard_similarity.py +++ b/hcga/features/jaccard_similarity.py @@ -82,16 +82,6 @@ def degree_assortativity_coeff(graph): return nx.degree_assortativity_coefficient(jaccard_similarity(graph)) -def graph_clique_number(graph): - """graph_clique_number""" - return max(len(c) for c in nx.clique.find_cliques(jaccard_similarity(graph))) - - -def num_max_cliques(graph): - """num_max_cliques""" - return sum(1 for _ in nx.clique.find_cliques(jaccard_similarity(graph))) - - def transitivity(graph): """transitivity""" return nx.transitivity(jaccard_similarity(graph)) @@ -117,16 +107,6 @@ def global_efficiency(graph): return nx.global_efficiency(jaccard_similarity(graph)) -def node_connectivity(graph): - """node_connectivity""" - return nx.node_connectivity(jaccard_similarity(graph)) - - -def edge_connectivity(graph): - """edge_connectivity""" - return nx.edge_connectivity(jaccard_similarity(graph)) - - class JaccardSimilarity(FeatureClass): """Jaccard Similarity class.""" @@ -164,7 +144,6 @@ def compute_features(self): "Diameter of Jaccard similarity graph", InterpretabilityScore(5), ) - self.add_feature( "radius", radius, @@ -180,21 +159,6 @@ def compute_features(self): InterpretabilityScore(4), ) - # Cliques - self.add_feature( - "graph_clique_number", - graph_clique_number, - "The size of the largest clique in the Jaccard similarity graph", - InterpretabilityScore(3), - ) - - self.add_feature( - "num_max_cliques", - num_max_cliques, - "The number of maximal cliques in the Jaccard similarity graph", - InterpretabilityScore(3), - ) - # Clustering self.add_feature( "transitivity", @@ -232,18 +196,3 @@ def compute_features(self): "The global efficiency", InterpretabilityScore(4), ) - - # Node connectivity - self.add_feature( - "node_connectivity", - node_connectivity, - "Node connectivity", - InterpretabilityScore(4), - ) - - self.add_feature( - "edge_connectivity", - edge_connectivity, - "Edge connectivity", - InterpretabilityScore(4), - ) diff --git a/hcga/graph.py b/hcga/graph.py index 6fbcfb08..9d150e12 100644 --- a/hcga/graph.py +++ b/hcga/graph.py @@ -282,7 +282,7 @@ def convert_graph( # pylint: disable=too-many-branches label = [label] if isinstance(graph, nx.Graph): - A = nx.to_scipy_sparse_matrix(graph, weight="weight", format="coo") + A = nx.to_scipy_sparse_array(graph, weight="weight", format="coo") if not node_features: try: