def test_fscnmf(): """ Testing the FSCNMF node embedding. """ graph = nx.newman_watts_strogatz_graph(250, 10, 0.2) features = np.random.uniform(0, 1, (250, 128)) model = FSCNMF() model.fit(graph, features) embedding = model.get_embedding() assert embedding.shape[0] == graph.number_of_nodes() assert embedding.shape[1] == 2 * model.dimensions
graphs = [nx.newman_watts_strogatz_graph(50, 5, 0.3) for _ in range(100)] model = SF() model.fit(graphs) model.get_embedding() #----------------- # FSCNMF example #----------------- g = nx.newman_watts_strogatz_graph(200, 20, 0.05) x = np.random.uniform(0, 1, (200, 200)) model = FSCNMF() model.fit(g, x) #--------------- # TADW example #--------------- g = nx.newman_watts_strogatz_graph(200, 20, 0.05) x = np.random.uniform(0, 1, (200, 200)) model = TADW() model.fit(g, x)
"""FCNMF example.""" import numpy as np import networkx as nx from karateclub.node_embedding.attributed import FSCNMF g = nx.newman_watts_strogatz_graph(200, 20, 0.05) x = np.random.uniform(0, 1, (200, 200)) model = FSCNMF() model.fit(g, x)
from karateclub.community_detection.overlapping import EgoNetSplitter, NNSED, DANMF, MNMF, BigClam from karateclub.community_detection.non_overlapping import EdMot, LabelPropagation from karateclub.graph_embedding import Graph2Vec, FGSD, GL2Vec from karateclub.node_embedding.attributed import BANE, TENE, TADW, FSCNMF from karateclub.node_embedding.structural import GraphWave from karateclub.dataset import GraphReader, GraphSetReader #----------------------------------- # FSCNMF example #----------------------------------- g = nx.newman_watts_strogatz_graph(200, 20, 0.05) x = np.random.uniform(0, 1, (200, 200)) model = FSCNMF() model.fit(g, x) quit() #----------------------------------- # TADW example #----------------------------------- g = nx.newman_watts_strogatz_graph(200, 20, 0.05) x = np.random.uniform(0, 1, (200, 200)) model = TADW()