Skip to content
A general purpose community detection and network embedding library for research built on NetworkX.
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Create FUNDING.yml Jan 24, 2020
dataset Reddit 10K dataset Jan 9, 2020
docs SCD added Feb 15, 2020
karateclub Add SCD Example. Feb 16, 2020
.gitignore ignore Dec 5, 2019
LICENSE LICENSE Jan 16, 2020 SCD added Feb 15, 2020 Add SCD Example. Feb 16, 2020
karatelogo.jpg KarateClub Logo Jan 7, 2020
readthedocs.yml Add files via upload Dec 6, 2019
setup.cfg helpers Dec 5, 2019 Edmot Fix. Feb 16, 2020

Version GitHub stars GitHub forks License PyPI download month


Karate Club is an unsupervised machine learning extension library for NetworkX.

Karate Club consists of state-of-the-art methods to do unsupervised learning on graph structured data. To put it simply it is a Swiss Army knife for small-scale graph mining research. First, it provides network embedding techniques at the node and graph level. Second, it includes a variety of overlapping and non-overlapping community detection methods. Implemented methods cover a wide range of network science (NetSci, Complenet), data mining (ICDM, CIKM, KDD), artificial intelligence (AAAI, IJCAI) and machine learning (NeurIPS, ICML, ICLR) conferences, workshops, and pieces from prominent journals.


If you find Karate Club useful in your research, please consider citing the following paper:

       title = {Karate Club: An open-source Python framework for unsupervised learning on graphs},   
       author = {Benedek Rozemberczki and Rik Sarkar},   
       year = {2020},   
       publisher = {GitHub},   
       journal = {GitHub repository},   
       howpublished = {\url{}}   

A simple example

Karate Club makes the use of modern community detection tecniques quite easy (see here for the accompanying tutorial). For example, this is all it takes to use on a Watts-Strogatz graph Ego-splitting:

import networkx as nx
from karateclub import EgoNetSplitter

g = nx.newman_watts_strogatz_graph(1000, 20, 0.05)

splitter = EgoNetSplitter(1.0)


Models included

In detail, the following community detection and embedding methods were implemented.

Overlapping Community Detection

Non-Overlapping Community Detection

Neighbourhood-Based Node Level Embedding

Structural Node Level Embedding

Attributed Node Level Embedding

Graph Level Embedding

Head over to our documentation to find out more about installation and data handling, a full list of implemented methods, and datasets. For a quick start, check out our examples.

If you notice anything unexpected, please open an issue and let us know. If you are missing a specific method, feel free to open a feature request. We are motivated to constantly make Karate Club even better.


Karate Club can be installed with the following pip command.

$ pip install karateclub

As we create new releases frequently, upgrading the package casually might be beneficial.

$ pip install karateclub --upgrade

Running examples

As part of the documentation we provide a number of use cases to show how the clusterings and embeddings can be utilized for downstream learning. These can accessed here with detailed explanations.

Besides the case studies we provide synthetic examples for each model. These can be tried out by running the examples script.

$ python
You can’t perform that action at this time.