In [1]:
import kmapper
from sklearn import datasets
import networkx as nx
In [2]:
data = datasets.make_circles(n_samples=1000)[0]
In [3]:
km = kmapper.KeplerMapper()
lens = km.project(data)
graph = km.map(X=data, lens=lens)
In [4]:
nx_graph = kmapper.adapter.to_nx(graph)
In [6]:
nx.draw(nx_graph)
In [ ]: