def templateTextTreeRepresentation(self, sample_path): sample = read_sample(sample_path) tree = kdtree(sample) representation = kdtree_text_visualizer(tree).visualize(False) assert representation != None assert len(representation) > 0 amount_lines = representation.count("\n") expected_lower_edge = math.log2(len(sample)) * len(sample[0]) assert expected_lower_edge <= amount_lines
def templateTextTreeRepresentation(self, sample_path, numpy_usage=False): sample = read_sample(sample_path); if numpy_usage is True: sample = numpy.array(sample) tree = kdtree(sample); representation = kdtree_text_visualizer(tree).visualize(False); assert representation != None; assert len(representation) > 0; amount_lines = representation.count("\n"); expected_lower_edge = math.log2(len(sample)) * len(sample[0]); assert expected_lower_edge <= amount_lines;
def template_build_visualize(sample_path): print("KD Tree for sample: '" + sample_path + "'"); sample = read_sample(sample_path); tree_instance = kdtree(sample); kdtree_text_visualizer(tree_instance).visualize(True);
def template_build_visualize(sample_path): print("KD Tree for sample: '" + sample_path + "'") sample = read_sample(sample_path) tree_instance = kdtree(sample) kdtree_text_visualizer(tree_instance).visualize(True)