Skip to main content

Python implementation of Mapper algorithm for Topological Data Analysis.

Project description

PyPI version Downloads Build Status Codecov DOI DOI


Nature uses as little as possible of anything. - Johannes Kepler

This is a Python implementation of the TDA Mapper algorithm for visualization of high-dimensional data. For complete documentation, see

KeplerMapper employs approaches based on the Mapper algorithm (Singh et al.) as first described in the paper "Topological Methods for the Analysis of High Dimensional Data Sets and 3D Object Recognition".

KeplerMapper can make use of Scikit-Learn API compatible cluster and scaling algorithms.



KeplerMapper requires:

  • Python (>= 2.7 or >= 3.3)
  • NumPy
  • Scikit-learn

Using the plotly visualizations requires a few extra libraries:

  • Python-Igraph
  • Plotly
  • Ipywidgets

Additionally, running some of the examples requires:

  • matplotlib
  • umap-learn


Install KeplerMapper with pip:

pip install kmapper

To install from source:

git clone
cd kepler-mapper
pip install -e .


KeplerMapper adopts the scikit-learn API as much as possible, so it should feel very familiar to anyone who has used these libraries.

Python code

# Import the class
import kmapper as km

# Some sample data
from sklearn import datasets
data, labels = datasets.make_circles(n_samples=5000, noise=0.03, factor=0.3)

# Initialize
mapper = km.KeplerMapper(verbose=1)

# Fit to and transform the data
projected_data = mapper.fit_transform(data, projection=[0,1]) # X-Y axis

# Create dictionary called 'graph' with nodes, edges and meta-information
graph =, data, cover=km.Cover(n_cubes=10))

# Visualize it
mapper.visualize(graph, path_html="make_circles_keplermapper_output.html",
                 title="make_circles(n_samples=5000, noise=0.03, factor=0.3)")


Standard MIT disclaimer applies, see for full text. Development status is Alpha.

How to cite

To credit KeplerMapper in your work, please cite both the JOSS paper and the Zenodo archive. The former provides a high level description of the package, and the latter points to a permanent record of all KeplerMapper versions (we encourage you to cite the specific version you used). Example citations (for KeplerMapper 1.3.3):

van Veen et al., (2019). Kepler Mapper: A flexible Python implementation of the Mapper algorithm. Journal of Open Source Software, 4(42), 1315,

Hendrik Jacob van Veen, Nathaniel Saul, Eargle, David, & Sam W. Mangham. (2019, October 14). Kepler Mapper: A flexible Python implementation of the Mapper algorithm (Version 1.3.3). Zenodo.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kmapper-1.4.1.tar.gz (100.7 kB view hashes)

Uploaded Source

Built Distribution

kmapper-1.4.1-py3-none-any.whl (95.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page