def template_clustering(data_path, levels, **kwargs): print("Sample: '%s'." % os.path.basename(data_path)) density_threshold = kwargs.get("density_threshold", 0.0) amount_threshold = kwargs.get("amount_threshold", 0) data = read_sample(data_path) bang_instance = bang(data, levels, density_threshold=density_threshold, amount_threshold=amount_threshold) bang_instance.process() clusters = bang_instance.get_clusters() noise = bang_instance.get_noise() directory = bang_instance.get_directory() dendrogram = bang_instance.get_dendrogram() bang_visualizer.show_blocks(directory) bang_visualizer.show_dendrogram(dendrogram) bang_visualizer.show_clusters(data, clusters, noise) if len(data[0]) == 2: animator = bang_animator(directory, clusters) animator.animate()
def animate(path, levels, threshold, ccore, **kwargs): sample = read_sample(path) bang_instance = bang(sample, levels, threshold, ccore) bang_instance.process() directory = bang_instance.get_directory() clusters = bang_instance.get_clusters() noise = bang_instance.get_noise() animator = bang_animator(directory, clusters, noise) animator.animate()
def template_clustering(data_path, levels, **kwargs): print("Sample: '%s'." % os.path.basename(data_path)) density_threshold = kwargs.get("density_threshold", 0.0) amount_threshold = kwargs.get("amount_threshold", 0) data = read_sample(data_path) bang_instance = bang(data, levels, density_threshold=density_threshold, amount_threshold=amount_threshold) bang_instance.process() clusters = bang_instance.get_clusters() noise = bang_instance.get_noise() directory = bang_instance.get_directory() dendrogram = bang_instance.get_dendrogram() bang_visualizer.show_blocks(directory) bang_visualizer.show_dendrogram(dendrogram) bang_visualizer.show_clusters(data, clusters, noise) if len(data[0]) == 2: animator = bang_animator(directory, clusters) animator.animate()