A basic, fast-paced, and hopefully understandable introduction to ideas and applications of topological data analysis (TDA) using Dionysus in Python.
Topological Data Analysis main points, extremely informally:
Famously, "the coffee cup is topologically equivalent to a donut".
Think of rescaling features as a deformation
In [38]:
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
# Local companion package
from topology.data import coffee_mug
from topology.data import pail
from topology.plotting import plot_mug_3D
from topology.plotting import plot_pail_3D
from topology.plotting import plot_circle_2D
%matplotlib notebook
In [1]:
from IPython.display import Image
from IPython.display import display
#https://en.wikipedia.org/wiki/File:Mug_and_Torus_morph.gif
display(Image(url="images/Mug_and_Torus_morph.gif"))
Dionysus is a package for analyzing the topology (think holes, circles, handles, and the higher dimensional analogues) of data.
It uses "persistent homology":
In [39]:
plot_circle_2D()
Out[39]:
In [ ]:
In [35]:
plot_mug_3D()
plot_pail_3D()
Out[35]:
Many dimensional reduction methods will obscure the topological nature of your data. Here is an example of where PCA does a good job of keeping some of the character of a coffee mug, but doesn't do well with a bucket.
In [8]:
%run pca_demo.py
In [1]:
%run d_explore.py
In [ ]: