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


Python KmeansTestTemplates.templateLengthProcessData方法代码示例

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


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

示例1: templateKmeansPlusPlusForClustering

# 需要导入模块: from pyclustering.cluster.tests.kmeans_templates import KmeansTestTemplates [as 别名]
# 或者: from pyclustering.cluster.tests.kmeans_templates.KmeansTestTemplates import templateLengthProcessData [as 别名]
 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,代码行数:16,代码来源:ut_center_initializer.py

示例2: testClusterAllocationSampleSimple5ChiSquare

# 需要导入模块: from pyclustering.cluster.tests.kmeans_templates import KmeansTestTemplates [as 别名]
# 或者: from pyclustering.cluster.tests.kmeans_templates.KmeansTestTemplates import templateLengthProcessData [as 别名]
 def testClusterAllocationSampleSimple5ChiSquare(self):
     metric = distance_metric(type_metric.CHI_SQUARE)
     KmeansTestTemplates.templateLengthProcessData(SIMPLE_SAMPLES.SAMPLE_SIMPLE5, [[3.4, 2.6], [3.4, -3.2], [-3.4, -3.4], [-3.1, 3.3]], [15, 15, 15, 15], False, metric=metric)
开发者ID:annoviko,项目名称:pyclustering,代码行数:5,代码来源:ut_kmeans.py

示例3: testClusterOneAllocationSampleSimple2

# 需要导入模块: from pyclustering.cluster.tests.kmeans_templates import KmeansTestTemplates [as 别名]
# 或者: from pyclustering.cluster.tests.kmeans_templates.KmeansTestTemplates import templateLengthProcessData [as 别名]
 def testClusterOneAllocationSampleSimple2(self):
     KmeansTestTemplates.templateLengthProcessData(SIMPLE_SAMPLES.SAMPLE_SIMPLE2, [[0.5, 0.2]], [23], False)
开发者ID:annoviko,项目名称:pyclustering,代码行数:4,代码来源:ut_kmeans.py

示例4: testClusterAllocationSampleSimple1ChiSquare

# 需要导入模块: from pyclustering.cluster.tests.kmeans_templates import KmeansTestTemplates [as 别名]
# 或者: from pyclustering.cluster.tests.kmeans_templates.KmeansTestTemplates import templateLengthProcessData [as 别名]
 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,代码行数:5,代码来源:ut_kmeans.py

示例5: testClusterAllocationSampleSimple1UserDefinedInfitityProcessing

# 需要导入模块: from pyclustering.cluster.tests.kmeans_templates import KmeansTestTemplates [as 别名]
# 或者: from pyclustering.cluster.tests.kmeans_templates.KmeansTestTemplates import templateLengthProcessData [as 别名]
 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,代码行数:5,代码来源:ut_kmeans.py

示例6: testClusterAllocationSampleSimple1UserDefined1

# 需要导入模块: from pyclustering.cluster.tests.kmeans_templates import KmeansTestTemplates [as 别名]
# 或者: from pyclustering.cluster.tests.kmeans_templates.KmeansTestTemplates import templateLengthProcessData [as 别名]
 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,代码行数:5,代码来源:ut_kmeans.py

示例7: testClusterAllocationSampleSimple1Manhattan

# 需要导入模块: from pyclustering.cluster.tests.kmeans_templates import KmeansTestTemplates [as 别名]
# 或者: from pyclustering.cluster.tests.kmeans_templates.KmeansTestTemplates import templateLengthProcessData [as 别名]
 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,代码行数:5,代码来源:ut_kmeans.py

示例8: testClusterAllocationSampleSimple1

# 需要导入模块: from pyclustering.cluster.tests.kmeans_templates import KmeansTestTemplates [as 别名]
# 或者: from pyclustering.cluster.tests.kmeans_templates.KmeansTestTemplates import templateLengthProcessData [as 别名]
 def testClusterAllocationSampleSimple1(self):
     KmeansTestTemplates.templateLengthProcessData(SIMPLE_SAMPLES.SAMPLE_SIMPLE1, [[3.7, 5.5], [6.7, 7.5]], [5, 5], False)
开发者ID:annoviko,项目名称:pyclustering,代码行数:4,代码来源:ut_kmeans.py

示例9: testWrongNumberOfCentersSimpleSample3

# 需要导入模块: from pyclustering.cluster.tests.kmeans_templates import KmeansTestTemplates [as 别名]
# 或者: from pyclustering.cluster.tests.kmeans_templates.KmeansTestTemplates import templateLengthProcessData [as 别名]
 def testWrongNumberOfCentersSimpleSample3(self):
     KmeansTestTemplates.templateLengthProcessData(SIMPLE_SAMPLES.SAMPLE_SIMPLE3, [[4.5, 3.4], [-1.7, 4.3], [1.5, 1.0], [11.3, 1.2], [-4.6, -5.2]], None, False)
开发者ID:annoviko,项目名称:pyclustering,代码行数:4,代码来源:ut_kmeans.py

示例10: testWrongNumberOfCentersSimpleSample2

# 需要导入模块: from pyclustering.cluster.tests.kmeans_templates import KmeansTestTemplates [as 别名]
# 或者: from pyclustering.cluster.tests.kmeans_templates.KmeansTestTemplates import templateLengthProcessData [as 别名]
 def testWrongNumberOfCentersSimpleSample2(self):
     KmeansTestTemplates.templateLengthProcessData(SIMPLE_SAMPLES.SAMPLE_SIMPLE2, [[1.3, 1.5], [5.2, 8.5], [5.0, 7.8], [11.0, -3.0]], None, False)
开发者ID:annoviko,项目名称:pyclustering,代码行数:4,代码来源:ut_kmeans.py

示例11: testWrongNumberOfCentersSimpleSample1

# 需要导入模块: from pyclustering.cluster.tests.kmeans_templates import KmeansTestTemplates [as 别名]
# 或者: from pyclustering.cluster.tests.kmeans_templates.KmeansTestTemplates import templateLengthProcessData [as 别名]
 def testWrongNumberOfCentersSimpleSample1(self):
     KmeansTestTemplates.templateLengthProcessData(SIMPLE_SAMPLES.SAMPLE_SIMPLE1, [[2.0, 4.5], [3.3, 6.5], [5.0, 7.8]], None, False)
开发者ID:annoviko,项目名称:pyclustering,代码行数:4,代码来源:ut_kmeans.py

示例12: testClusterOneDimensionSampleSimple8

# 需要导入模块: from pyclustering.cluster.tests.kmeans_templates import KmeansTestTemplates [as 别名]
# 或者: from pyclustering.cluster.tests.kmeans_templates.KmeansTestTemplates import templateLengthProcessData [as 别名]
 def testClusterOneDimensionSampleSimple8(self):
     KmeansTestTemplates.templateLengthProcessData(SIMPLE_SAMPLES.SAMPLE_SIMPLE8, [[-4.0], [3.1], [6.1], [12.0]], [15, 30, 20, 80], False)
开发者ID:annoviko,项目名称:pyclustering,代码行数:4,代码来源:ut_kmeans.py

示例13: testClusterAllocationSampleSimple7ChiSquare

# 需要导入模块: from pyclustering.cluster.tests.kmeans_templates import KmeansTestTemplates [as 别名]
# 或者: from pyclustering.cluster.tests.kmeans_templates.KmeansTestTemplates import templateLengthProcessData [as 别名]
 def testClusterAllocationSampleSimple7ChiSquare(self):
     metric = distance_metric(type_metric.CHI_SQUARE)
     KmeansTestTemplates.templateLengthProcessData(SIMPLE_SAMPLES.SAMPLE_SIMPLE7, [[-3.0], [2.0]], [10, 10], False, metric=metric)
开发者ID:annoviko,项目名称:pyclustering,代码行数:5,代码来源:ut_kmeans.py

示例14: testClusterAllocationSampleSimple7Canberra

# 需要导入模块: from pyclustering.cluster.tests.kmeans_templates import KmeansTestTemplates [as 别名]
# 或者: from pyclustering.cluster.tests.kmeans_templates.KmeansTestTemplates import templateLengthProcessData [as 别名]
 def testClusterAllocationSampleSimple7Canberra(self):
     metric = distance_metric(type_metric.CANBERRA)
     KmeansTestTemplates.templateLengthProcessData(SIMPLE_SAMPLES.SAMPLE_SIMPLE7, [[-3.0], [2.0]], [10, 10], False, metric=metric)
开发者ID:annoviko,项目名称:pyclustering,代码行数:5,代码来源:ut_kmeans.py

示例15: testClusterOneDimensionSampleSimple7

# 需要导入模块: from pyclustering.cluster.tests.kmeans_templates import KmeansTestTemplates [as 别名]
# 或者: from pyclustering.cluster.tests.kmeans_templates.KmeansTestTemplates import templateLengthProcessData [as 别名]
 def testClusterOneDimensionSampleSimple7(self):
     KmeansTestTemplates.templateLengthProcessData(SIMPLE_SAMPLES.SAMPLE_SIMPLE7, [[-3.0], [2.0]], [10, 10], False)
开发者ID:annoviko,项目名称:pyclustering,代码行数:4,代码来源:ut_kmeans.py


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