Exemplo n.º 1
0
 def testAllocatedRequestedClustersWithTheSamePoints2(self):
     sample = [[0.23, 0.2], [-0.1, 0.1], [0.0, 0.9], [0.1, -0.2],
               [0.8, 0.1], [-0.1, 0.1], [-0.4, -0.2], [0.0, 0.9]]
     answers = [1, 2, 3, 4, 5, 6, 6, 6]
     for expected_amount in answers:
         kmedoids_test_template.templateAllocateRequestedClusterAmount(
             sample, expected_amount, None, True)
Exemplo n.º 2
0
 def testAllocatedRequestedClustersSampleSimple03(self):
     sample = read_sample(SIMPLE_SAMPLES.SAMPLE_SIMPLE3)
     kmedoids_test_template.templateAllocateRequestedClusterAmount(sample, 2, None, False)
     kmedoids_test_template.templateAllocateRequestedClusterAmount(sample, 5, None, False)
     kmedoids_test_template.templateAllocateRequestedClusterAmount(sample, 8, None, False)
     kmedoids_test_template.templateAllocateRequestedClusterAmount(sample, 10, None, False)
     kmedoids_test_template.templateAllocateRequestedClusterAmount(sample, 15, None, False)
Exemplo n.º 3
0
 def testAllocatedRequestedClustersWithTotallyTheSamePoints(self):
     # Bug issue #366 - Kmedoids returns incorrect number of clusters.
     sample = [ [0.0, 0.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0] ]
     kmedoids_test_template.templateAllocateRequestedClusterAmount(sample, 4, None, False)
     kmedoids_test_template.templateAllocateRequestedClusterAmount(sample, 3, None, False)
     kmedoids_test_template.templateAllocateRequestedClusterAmount(sample, 2, None, False)
     kmedoids_test_template.templateAllocateRequestedClusterAmount(sample, 1, None, False)
Exemplo n.º 4
0
 def testAllocatedRequestedClustersWithTheSamePointsByCore(self):
     # Bug issue #366 - Kmedoids returns incorrect number of clusters.
     sample = [[0.0, 0.0], [0.1, 0.1], [0.0, 0.0], [0.1, 0.2]]
     kmedoids_test_template.templateAllocateRequestedClusterAmount(sample, 3, None, True)
     kmedoids_test_template.templateAllocateRequestedClusterAmount(sample, 3, None, True)
     kmedoids_test_template.templateAllocateRequestedClusterAmount(sample, 2, None, True)
     kmedoids_test_template.templateAllocateRequestedClusterAmount(sample, 1, None, True)
Exemplo n.º 5
0
 def testAllocatedRequestedClustersSampleSimple04ByCore(self):
     sample = read_sample(SIMPLE_SAMPLES.SAMPLE_SIMPLE4)
     kmedoids_test_template.templateAllocateRequestedClusterAmount(
         sample, 10, None, True)
     kmedoids_test_template.templateAllocateRequestedClusterAmount(
         sample, 25, None, True)
     kmedoids_test_template.templateAllocateRequestedClusterAmount(
         sample, 40, None, True)