本文整理汇总了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;
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)