karateclub.dataset

class GraphReader(dataset: str = 'wikipedia')[source]

Class to read benchmark datasets for the community detection or node embedding task.

Parameters:dataset (str) – Dataset of interest, one of: ("facebook", "twitch", "wikipedia", "github", "lastfm", "deezer"). Default is ‘wikipedia’.
get_features() → scipy.sparse.coo.coo_matrix[source]

Getting the node features Scipy matrix.

Return types:
  • features (COO Scipy array) - Node feature matrix.
get_graph() → networkx.classes.graph.Graph[source]

Getting the graph.

Return types:
  • graph (NetworkX graph) - Graph of interest.
get_target() → numpy.array[source]

Getting the class membership of nodes.

Return types:
  • target (Numpy array) - Class membership vector.
class GraphSetReader(dataset: str = 'reddit10k')[source]

Class to read benchmark datasets for the graph level embedding task.

Parameters:dataset (str) – Dataset of interest one of reddit10k. Default is ‘reddit10k’.
get_graphs() → List[networkx.classes.graph.Graph][source]

Getting the graphs.

Return types:
  • graphs (List of NetworkX graphs) - Graphs of interest.
get_target() → numpy.array[source]

Getting the class membership of graphs.

Return types:
  • target (Numpy array) - Class membership vector.