How to use the kmapper.draw_matplotlib function in kmapper

To help you get started, we’ve selected a few kmapper examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github scikit-tda / kepler-mapper / test / test_drawing.py View on Github external
def test_mapper_input(self, mapper):
        draw_matplotlib(mapper)
github scikit-tda / kepler-mapper / _downloads / 35016702dc7836dc0a96ff7b1005e407 / plot_cat.py View on Github external
data = np.genfromtxt('data/cat-reference.csv', delimiter=',')

mapper = km.KeplerMapper(verbose=2)

lens = mapper.fit_transform(data)

graph = mapper.map(lens,
                   data,
                   clusterer=sklearn.cluster.DBSCAN(eps=0.1, min_samples=5),
                   cover=km.Cover(n_cubes=15, perc_overlap=0.2))

mapper.visualize(graph,
                 path_html="output/cat.html")

km.draw_matplotlib(graph)

import matplotlib.pyplot as plt
plt.show()
github scikit-tda / kepler-mapper / _downloads / b1ca15be7f63dd8df51bac2ddfeb6673 / plot_digits.py View on Github external
# Create the visualizations (increased the graph_gravity for a tighter graph-look.)
print("Output graph examples to html" )
# Tooltips with image data for every cluster member
mapper.visualize(graph,
                 title="Handwritten digits Mapper",
                 path_html="output/digits_custom_tooltips.html",
                 color_function=labels,
                 custom_tooltips=tooltip_s)
# Tooltips with the target y-labels for every cluster member
mapper.visualize(graph,
                 title="Handwritten digits Mapper",
                 path_html="output/digits_ylabel_tooltips.html",
                 custom_tooltips=labels)

# Matplotlib examples
km.draw_matplotlib(graph, layout="spring")
plt.show()