Getting started with Mapper
===========================
In this notebook we explore a few of the core features included in
``giotto-tda``\ ’s implementation of the `Mapper
algorithm `__.
If you are looking at a static version of this notebook and would like
to run its contents, head over to
`GitHub `__
and download the source.
Useful references
-----------------
- `An introduction to Topological Data Analysis: fundamental and
practical aspects for data
scientists `__
- `An Introduction to Topological Data Analysis for Physicists: From
LGM to FRBs `__
**License: AGPLv3**
Import libraries
----------------
.. code:: ipython3
# Data wrangling
import numpy as np
import pandas as pd # Not a requirement of giotto-tda, but is compatible with the gtda.mapper module
# Data viz
from gtda.plotting import plot_point_cloud
# TDA magic
from gtda.mapper import (
CubicalCover,
make_mapper_pipeline,
Projection,
plot_static_mapper_graph,
plot_interactive_mapper_graph
)
# ML tools
from sklearn import datasets
from sklearn.cluster import DBSCAN
from sklearn.decomposition import PCA
Generate and visualise data
---------------------------
As a simple example, let’s generate a two-dimensional point cloud of two
concentric circles. The goal will be to examine how Mapper can be used
to generate a topological graph that captures the salient features of
the data.
.. code:: ipython3
data, _ = datasets.make_circles(n_samples=5000, noise=0.05, factor=0.3, random_state=42)
plot_point_cloud(data)
.. raw:: html