Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_mapper_input(self, mapper):
draw_matplotlib(mapper)
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()
# 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()