當前位置: 首頁>>代碼示例>>Python>>正文


Python kmedoids_templates.KmedoidsTestTemplates類代碼示例

本文整理匯總了Python中pyclustering.cluster.tests.kmedoids_templates.KmedoidsTestTemplates的典型用法代碼示例。如果您正苦於以下問題:Python KmedoidsTestTemplates類的具體用法?Python KmedoidsTestTemplates怎麽用?Python KmedoidsTestTemplates使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了KmedoidsTestTemplates類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: testAllocatedRequestedClustersSampleSimple03

 def testAllocatedRequestedClustersSampleSimple03(self):
     sample = read_sample(SIMPLE_SAMPLES.SAMPLE_SIMPLE3)
     KmedoidsTestTemplates.templateAllocateRequestedClusterAmount(sample, 2, None, False)
     KmedoidsTestTemplates.templateAllocateRequestedClusterAmount(sample, 5, None, False)
     KmedoidsTestTemplates.templateAllocateRequestedClusterAmount(sample, 8, None, False)
     KmedoidsTestTemplates.templateAllocateRequestedClusterAmount(sample, 10, None, False)
     KmedoidsTestTemplates.templateAllocateRequestedClusterAmount(sample, 15, None, False)
開發者ID:annoviko,項目名稱:pyclustering,代碼行數:7,代碼來源:ut_kmedoids.py

示例2: testAllocatedRequestedClustersWithTotallyTheSamePointsByCore

 def testAllocatedRequestedClustersWithTotallyTheSamePointsByCore(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] ]
     KmedoidsTestTemplates.templateAllocateRequestedClusterAmount(sample, 4, None, True)
     KmedoidsTestTemplates.templateAllocateRequestedClusterAmount(sample, 3, None, True)
     KmedoidsTestTemplates.templateAllocateRequestedClusterAmount(sample, 2, None, True)
     KmedoidsTestTemplates.templateAllocateRequestedClusterAmount(sample, 1, None, True)
開發者ID:annoviko,項目名稱:pyclustering,代碼行數:7,代碼來源:it_kmedoids.py

示例3: templateKmeansPlusPlusForKmedoidsClustering

    def templateKmeansPlusPlusForKmedoidsClustering(self, path_sample, amount, expected_clusters_length):
        result_success = True
        for _ in range(3):
            try:
                sample = read_sample(path_sample)
                start_medoids = kmeans_plusplus_initializer(sample, amount).initialize(return_index=True)
                KmedoidsTestTemplates.templateLengthProcessData(path_sample, start_medoids, expected_clusters_length,
                                                              False)

            except AssertionError:
                continue
            break

        assert result_success == True;
開發者ID:annoviko,項目名稱:pyclustering,代碼行數:14,代碼來源:ut_center_initializer.py

示例4: testClusterOneAllocationSampleSimple2DistanceMatrixByCore

 def testClusterOneAllocationSampleSimple2DistanceMatrixByCore(self):
     KmedoidsTestTemplates.templateLengthProcessData(SIMPLE_SAMPLES.SAMPLE_SIMPLE2, [10], [23], True, data_type='distance_matrix')
開發者ID:annoviko,項目名稱:pyclustering,代碼行數:2,代碼來源:it_kmedoids.py

示例5: testAllocatedRequestedClustersSampleSimple04ByCore

 def testAllocatedRequestedClustersSampleSimple04ByCore(self):
     sample = read_sample(SIMPLE_SAMPLES.SAMPLE_SIMPLE4)
     KmedoidsTestTemplates.templateAllocateRequestedClusterAmount(sample, 10, None, True)
     KmedoidsTestTemplates.templateAllocateRequestedClusterAmount(sample, 25, None, True)
     KmedoidsTestTemplates.templateAllocateRequestedClusterAmount(sample, 40, None, True)
開發者ID:annoviko,項目名稱:pyclustering,代碼行數:5,代碼來源:it_kmedoids.py

示例6: testClusterAllocationSampleSimple1

 def testClusterAllocationSampleSimple1(self):
     KmedoidsTestTemplates.templateLengthProcessData(SIMPLE_SAMPLES.SAMPLE_SIMPLE1, [2, 9], [5, 5], False)
開發者ID:annoviko,項目名稱:pyclustering,代碼行數:2,代碼來源:ut_kmedoids.py

示例7: testClusterAllocationSampleSimple1UserDefinedDistanceMatrixByCore

 def testClusterAllocationSampleSimple1UserDefinedDistanceMatrixByCore(self):
     metric = distance_metric(type_metric.USER_DEFINED, func=distance_metric(type_metric.EUCLIDEAN))
     KmedoidsTestTemplates.templateLengthProcessWithMetric(SIMPLE_SAMPLES.SAMPLE_SIMPLE1, [2, 9], [5, 5], metric, True, data_type='distance_matrix')
開發者ID:annoviko,項目名稱:pyclustering,代碼行數:3,代碼來源:it_kmedoids.py

示例8: testClusterAllocationSampleSimple1ChebyshevDistanceMatrixByCore

 def testClusterAllocationSampleSimple1ChebyshevDistanceMatrixByCore(self):
     metric = distance_metric(type_metric.CHEBYSHEV)
     KmedoidsTestTemplates.templateLengthProcessWithMetric(SIMPLE_SAMPLES.SAMPLE_SIMPLE1, [2, 9], [5, 5], metric, True, data_type='distance_matrix')
開發者ID:annoviko,項目名稱:pyclustering,代碼行數:3,代碼來源:it_kmedoids.py

示例9: testClusterAllocationSampleSimple1SquareEuclideanDistanceMatrixByCore

 def testClusterAllocationSampleSimple1SquareEuclideanDistanceMatrixByCore(self):
     metric = distance_metric(type_metric.EUCLIDEAN_SQUARE)
     KmedoidsTestTemplates.templateLengthProcessWithMetric(SIMPLE_SAMPLES.SAMPLE_SIMPLE1, [2, 9], [5, 5], metric, True, data_type='distance_matrix')
開發者ID:annoviko,項目名稱:pyclustering,代碼行數:3,代碼來源:it_kmedoids.py

示例10: testClusterAllocationSampleSimple1DistanceMatrixByCore

 def testClusterAllocationSampleSimple1DistanceMatrixByCore(self):
     KmedoidsTestTemplates.templateLengthProcessData(SIMPLE_SAMPLES.SAMPLE_SIMPLE1, [2, 9], [5, 5], True, data_type='distance_matrix')
開發者ID:annoviko,項目名稱:pyclustering,代碼行數:2,代碼來源:it_kmedoids.py

示例11: testItermax10Simple01

 def testItermax10Simple01(self):
     KmedoidsTestTemplates.templateLengthProcessData(SIMPLE_SAMPLES.SAMPLE_SIMPLE1, [2, 9], [5, 5], True, itermax=10)
開發者ID:annoviko,項目名稱:pyclustering,代碼行數:2,代碼來源:it_kmedoids.py

示例12: testProcessingWhenLibraryCoreCorrupted

 def testProcessingWhenLibraryCoreCorrupted(self):
     KmedoidsTestTemplates.templateLengthProcessData(SIMPLE_SAMPLES.SAMPLE_SIMPLE1, [2, 9], [5, 5], True)
開發者ID:annoviko,項目名稱:pyclustering,代碼行數:2,代碼來源:it_kmedoids.py

示例13: testClusterAllocationSampleSimple2ByCore

 def testClusterAllocationSampleSimple2ByCore(self):
     KmedoidsTestTemplates.templateLengthProcessData(SIMPLE_SAMPLES.SAMPLE_SIMPLE2, [3, 12, 20], [10, 5, 8], True)
開發者ID:annoviko,項目名稱:pyclustering,代碼行數:2,代碼來源:it_kmedoids.py

示例14: testClusterAllocationSampleSimple1Minkowski

 def testClusterAllocationSampleSimple1Minkowski(self):
     metric = distance_metric(type_metric.MINKOWSKI, degree=2.0)
     KmedoidsTestTemplates.templateLengthProcessWithMetric(SIMPLE_SAMPLES.SAMPLE_SIMPLE1, [2, 9], [5, 5], metric, False)
開發者ID:annoviko,項目名稱:pyclustering,代碼行數:3,代碼來源:ut_kmedoids.py

示例15: testClusterAllocationSampleSimple1Chebyshev

 def testClusterAllocationSampleSimple1Chebyshev(self):
     metric = distance_metric(type_metric.CHEBYSHEV)
     KmedoidsTestTemplates.templateLengthProcessWithMetric(SIMPLE_SAMPLES.SAMPLE_SIMPLE1, [2, 9], [5, 5], metric, False)
開發者ID:annoviko,項目名稱:pyclustering,代碼行數:3,代碼來源:ut_kmedoids.py


注:本文中的pyclustering.cluster.tests.kmedoids_templates.KmedoidsTestTemplates類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。