当前位置: 首页>>代码示例>>Python>>正文


Python kmeans_templates.KmeansTestTemplates类代码示例

本文整理汇总了Python中pyclustering.cluster.tests.kmeans_templates.KmeansTestTemplates的典型用法代码示例。如果您正苦于以下问题:Python KmeansTestTemplates类的具体用法?Python KmeansTestTemplates怎么用?Python KmeansTestTemplates使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了KmeansTestTemplates类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: templateKmeansPlusPlusForClustering

 def templateKmeansPlusPlusForClustering(self, path_sample, amount, expected_clusters_length):
     result_success = True
     for _ in range(3):
         try:
             sample = read_sample(path_sample)
             start_centers = kmeans_plusplus_initializer(sample, amount).initialize()
             KmeansTestTemplates.templateLengthProcessData(path_sample, start_centers, expected_clusters_length, False)
         
         except AssertionError:
             continue
         
         break
     
     assert result_success == True;
开发者ID:annoviko,项目名称:pyclustering,代码行数:14,代码来源:ut_center_initializer.py

示例2: testWrongNumberOfCentersSimpleSample5

 def testWrongNumberOfCentersSimpleSample5(self):
     KmeansTestTemplates.templateLengthProcessData(SIMPLE_SAMPLES.SAMPLE_SIMPLE5, [[-1.9, 3.2], [1.2, 34.5], [15.2, 34.8], [192, 234], [-32.3, -106]], None, False)
开发者ID:annoviko,项目名称:pyclustering,代码行数:2,代码来源:ut_kmeans.py

示例3: testClusterOneAllocationSampleSimple2

 def testClusterOneAllocationSampleSimple2(self):
     KmeansTestTemplates.templateLengthProcessData(SIMPLE_SAMPLES.SAMPLE_SIMPLE2, [[0.5, 0.2]], [23], False)
开发者ID:annoviko,项目名称:pyclustering,代码行数:2,代码来源:ut_kmeans.py

示例4: testClusterAllocationSampleSimple1ChiSquare

 def testClusterAllocationSampleSimple1ChiSquare(self):
     metric = distance_metric(type_metric.CHI_SQUARE)
     KmeansTestTemplates.templateLengthProcessData(SIMPLE_SAMPLES.SAMPLE_SIMPLE1, [[3.7, 5.5], [6.7, 7.5]], [5, 5], False, metric=metric)
开发者ID:annoviko,项目名称:pyclustering,代码行数:3,代码来源:ut_kmeans.py

示例5: testClusterAllocationSampleSimple1UserDefinedInfitityProcessing

 def testClusterAllocationSampleSimple1UserDefinedInfitityProcessing(self):
     metric = distance_metric(type_metric.USER_DEFINED, func=lambda p1, p2: p1[0] + p2[0] + 2)
     KmeansTestTemplates.templateLengthProcessData(SIMPLE_SAMPLES.SAMPLE_SIMPLE1, [[3.7, 5.5], [6.7, 7.5]], [10], False, metric=metric)
开发者ID:annoviko,项目名称:pyclustering,代码行数:3,代码来源:ut_kmeans.py

示例6: testClusterAllocationSampleSimple1UserDefined1

 def testClusterAllocationSampleSimple1UserDefined1(self):
     metric = distance_metric(type_metric.USER_DEFINED, func=distance_metric(type_metric.EUCLIDEAN))
     KmeansTestTemplates.templateLengthProcessData(SIMPLE_SAMPLES.SAMPLE_SIMPLE1, [[3.7, 5.5], [6.7, 7.5]], [5, 5], False, metric=metric)
开发者ID:annoviko,项目名称:pyclustering,代码行数:3,代码来源:ut_kmeans.py

示例7: testClusterAllocationSampleSimple1Manhattan

 def testClusterAllocationSampleSimple1Manhattan(self):
     metric = distance_metric(type_metric.MANHATTAN)
     KmeansTestTemplates.templateLengthProcessData(SIMPLE_SAMPLES.SAMPLE_SIMPLE1, [[3.7, 5.5], [6.7, 7.5]], [5, 5], False, metric=metric)
开发者ID:annoviko,项目名称:pyclustering,代码行数:3,代码来源:ut_kmeans.py

示例8: testClusterAllocationSampleSimple1

 def testClusterAllocationSampleSimple1(self):
     KmeansTestTemplates.templateLengthProcessData(SIMPLE_SAMPLES.SAMPLE_SIMPLE1, [[3.7, 5.5], [6.7, 7.5]], [5, 5], False)
开发者ID:annoviko,项目名称:pyclustering,代码行数:2,代码来源:ut_kmeans.py

示例9: testObserveSampleSimple1

 def testObserveSampleSimple1(self):
     KmeansTestTemplates.templateCollectEvolution(SIMPLE_SAMPLES.SAMPLE_SIMPLE1, [[3.5, 5.6], [6.8, 7.4]], [5, 5], False)
开发者ID:annoviko,项目名称:pyclustering,代码行数:2,代码来源:ut_kmeans.py

示例10: testClusterAllocationOneDimensionData

 def testClusterAllocationOneDimensionData(self):
     KmeansTestTemplates.templateClusterAllocationOneDimensionData(False)
开发者ID:annoviko,项目名称:pyclustering,代码行数:2,代码来源:ut_kmeans.py

示例11: testThreeDimensionalData1

 def testThreeDimensionalData1(self):
     KmeansTestTemplates.templateLengthProcessData(SIMPLE_SAMPLES.SAMPLE_SIMPLE11, [[1.0, 0.6, 0.8], [4.1, 4.2, 4.3]], [10, 10], False)
开发者ID:annoviko,项目名称:pyclustering,代码行数:2,代码来源:ut_kmeans.py

示例12: testOneDimensionalData2

 def testOneDimensionalData2(self):
     KmeansTestTemplates.templateLengthProcessData(SIMPLE_SAMPLES.SAMPLE_SIMPLE9, [[4.5], [6.2]], [20, 10], False)
开发者ID:annoviko,项目名称:pyclustering,代码行数:2,代码来源:ut_kmeans.py

示例13: testOneDimensionalData1

 def testOneDimensionalData1(self):
     KmeansTestTemplates.templateLengthProcessData(SIMPLE_SAMPLES.SAMPLE_SIMPLE8, [[-2.0], [3.0], [6.0], [12.0]], [15, 30, 20, 80], False)
开发者ID:annoviko,项目名称:pyclustering,代码行数:2,代码来源:ut_kmeans.py

示例14: testTheSameData2

 def testTheSameData2(self):
     KmeansTestTemplates.templateLengthProcessData(SIMPLE_SAMPLES.SAMPLE_SIMPLE12, [ [1.0, 1.0], [2.5, 2.5], [4.0, 4.0] ], [5, 5, 5], False)
开发者ID:annoviko,项目名称:pyclustering,代码行数:2,代码来源:ut_kmeans.py

示例15: testTheSameData1

 def testTheSameData1(self):
     KmeansTestTemplates.templateLengthProcessData(SIMPLE_SAMPLES.SAMPLE_SIMPLE9, [ [4.0], [8.0] ], [10, 20], False)
开发者ID:annoviko,项目名称:pyclustering,代码行数:2,代码来源:ut_kmeans.py


注:本文中的pyclustering.cluster.tests.kmeans_templates.KmeansTestTemplates类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。