Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def testBicClusterAllocationSampleTwoDiamonds(self):
self.templateLengthProcessData(FCPS_SAMPLES.SAMPLE_TWO_DIAMONDS, [[0.8, 0.2], [3.0, 0.0]], [400, 400], splitting_type.BAYESIAN_INFORMATION_CRITERION);
def testClusteringHepta(self):
self.templateClusteringResults(FCPS_SAMPLES.SAMPLE_HEPTA, 1, 3, [30, 30, 30, 30, 30, 30, 32], False);
self.templateClusteringResults(FCPS_SAMPLES.SAMPLE_HEPTA, 5, 3, [212], False);
def kmeans_plusplus_initializer_collection():
(sample1, centers1) = template_kmeans_plusplus_initializer(SIMPLE_SAMPLES.SAMPLE_SIMPLE1, 2, False)
(sample2, centers2) = template_kmeans_plusplus_initializer(SIMPLE_SAMPLES.SAMPLE_SIMPLE2, 3, False)
(sample3, centers3) = template_kmeans_plusplus_initializer(SIMPLE_SAMPLES.SAMPLE_SIMPLE3, 4, False)
(sample4, centers4) = template_kmeans_plusplus_initializer(FCPS_SAMPLES.SAMPLE_TWO_DIAMONDS, 2, False)
visualizer = cluster_visualizer(4, 2)
visualizer.append_cluster(sample1, canvas=0)
visualizer.append_cluster(centers1, canvas=0, marker='*', markersize=10)
visualizer.append_cluster(sample2, canvas=1)
visualizer.append_cluster(centers2, canvas=1, marker='*', markersize=10)
visualizer.append_cluster(sample3, canvas=2)
visualizer.append_cluster(centers3, canvas=2, marker='*', markersize=10)
visualizer.append_cluster(sample4, canvas=3)
visualizer.append_cluster(centers4, canvas=3, marker='*', markersize=10)
visualizer.show()
def cluster_lsun():
template_clustering(FCPS_SAMPLES.SAMPLE_LSUN)
def cluster_two_diamonds():
template_clustering(FCPS_SAMPLES.SAMPLE_TWO_DIAMONDS, 1.0, 2.0);
def experiment_execution_time(draw, ccore):
template_clustering(3, FCPS_SAMPLES.SAMPLE_LSUN, 5, 0.3, draw, ccore)
template_clustering(6, FCPS_SAMPLES.SAMPLE_TARGET, 10, 0.3, draw, ccore)
template_clustering(2, FCPS_SAMPLES.SAMPLE_TWO_DIAMONDS, 5, 0.3, draw, ccore)
template_clustering(2, FCPS_SAMPLES.SAMPLE_WING_NUT, 1, 1, draw, ccore)
template_clustering(2, FCPS_SAMPLES.SAMPLE_CHAINLINK, 5, 0.5, draw, ccore)
template_clustering(4, FCPS_SAMPLES.SAMPLE_TETRA, 5, 0.5, draw, ccore)
template_clustering(7, FCPS_SAMPLES.SAMPLE_HEPTA, 5, 0.5, draw, ccore)
template_clustering(2, FCPS_SAMPLES.SAMPLE_ATOM, 20, 0.2)
def experiment_execution_time(ccore):
template_clustering(SIMPLE_SAMPLES.SAMPLE_SIMPLE1, 1, 2, 0.5, False, ccore);
template_clustering(SIMPLE_SAMPLES.SAMPLE_SIMPLE2, 1, 3, 0.5, False, ccore);
template_clustering(SIMPLE_SAMPLES.SAMPLE_SIMPLE3, 1, 4, 0.5, False, ccore);
template_clustering(SIMPLE_SAMPLES.SAMPLE_SIMPLE4, 1, 5, 0.5, False, ccore);
template_clustering(SIMPLE_SAMPLES.SAMPLE_ELONGATE, 1, 2, 0.5, False, ccore);
template_clustering(FCPS_SAMPLES.SAMPLE_LSUN, 1, 3, 0.5, True, ccore);
template_clustering(FCPS_SAMPLES.SAMPLE_TARGET, 1.2, 6, 0.2, True, ccore);
template_clustering(FCPS_SAMPLES.SAMPLE_TWO_DIAMONDS, 0.2, 2, 0.2, True, ccore);
template_clustering(FCPS_SAMPLES.SAMPLE_WING_NUT, 0.3, 2, 0.2, True, ccore);
template_clustering(FCPS_SAMPLES.SAMPLE_CHAINLINK, 0.6, 2, 0.2, True, ccore);
template_clustering(FCPS_SAMPLES.SAMPLE_HEPTA, 1.2, 7, 0.2, True, ccore);
template_clustering(FCPS_SAMPLES.SAMPLE_TETRA, 0.5, 4, 0.2, True, ccore);
template_clustering(FCPS_SAMPLES.SAMPLE_ATOM, 15, 2, 0.2, True, ccore)
def cluster_hepta():
start_centers = [[0.0, 0.0, 0.0], [3.0, 0.0, 0.0], [-2.0, 0.0, 0.0], [0.0, 3.0, 0.0], [0.0, -3.0, 0.0],
[0.0, 0.0, 2.5], [0.0, 0.0, -2.5]]
template_clustering(start_centers, FCPS_SAMPLES.SAMPLE_HEPTA)
def cluster_lsun():
"Not so applicable for this sample"
start_centers = [[1.0, 3.5], [2.0, 0.5], [3.0, 3.0]]
template_clustering(start_centers, FCPS_SAMPLES.SAMPLE_LSUN)
def cluster_wing_nut():
start_medians = [[-1.5, 1.5], [1.5, 1.5]]
template_clustering(start_medians, FCPS_SAMPLES.SAMPLE_WING_NUT)