本文整理汇总了Python中pyprepbuddy.rdds.transformable_rdd.TransformableRDD.clusters方法的典型用法代码示例。如果您正苦于以下问题:Python TransformableRDD.clusters方法的具体用法?Python TransformableRDD.clusters怎么用?Python TransformableRDD.clusters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyprepbuddy.rdds.transformable_rdd.TransformableRDD
的用法示例。
在下文中一共展示了TransformableRDD.clusters方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_replace_values_should_replace_cluster_values_with_given_text
# 需要导入模块: from pyprepbuddy.rdds.transformable_rdd import TransformableRDD [as 别名]
# 或者: from pyprepbuddy.rdds.transformable_rdd.TransformableRDD import clusters [as 别名]
def test_replace_values_should_replace_cluster_values_with_given_text(self):
initial_dataset = self.sc.parallelize(["XA,Y", "A,B", "AX,Z", "A,Q", "A,E"])
transformable_rdd = TransformableRDD(initial_dataset)
clusters = transformable_rdd.clusters(0, NGramFingerprintAlgorithm(1))
one_cluster = clusters.get_all_clusters()[0]
values = transformable_rdd.replace_values(one_cluster, "Hello", 0).collect()
self.assertTrue(values.__contains__("Hello,B"))
示例2: test_clusters_should_give_clusters_By_n_gram_fingerprint
# 需要导入模块: from pyprepbuddy.rdds.transformable_rdd import TransformableRDD [as 别名]
# 或者: from pyprepbuddy.rdds.transformable_rdd.TransformableRDD import clusters [as 别名]
def test_clusters_should_give_clusters_By_n_gram_fingerprint(self):
rdd = self.sc.parallelize(["CLUSTER Of Finger print", "finger print of cluster", "finger print for cluster"])
transformable_rdd = TransformableRDD(rdd, 'csv')
clusters = transformable_rdd.clusters(0, NGramFingerprintAlgorithm(1))
list_of_clusters = clusters.get_all_clusters()
one_cluster = list_of_clusters[0]
self.assertTrue(one_cluster.__contains__("CLUSTER Of Finger print"))
self.assertTrue(one_cluster.__contains__("finger print for cluster"))
示例3: test_clusters_should_give_clusters_of_given_column_index
# 需要导入模块: from pyprepbuddy.rdds.transformable_rdd import TransformableRDD [as 别名]
# 或者: from pyprepbuddy.rdds.transformable_rdd.TransformableRDD import clusters [as 别名]
def test_clusters_should_give_clusters_of_given_column_index(self):
rdd = self.sc.parallelize(["CLUSTER Of Finger print", "finger print of cluster", "finger print for cluster"])
transformable_rdd = TransformableRDD(rdd, 'csv')
clusters = transformable_rdd.clusters(0, SimpleFingerprint())
list_of_clusters = clusters.get_all_clusters()
one_cluster = list_of_clusters[0]
self.assertTrue(one_cluster.__contains__("CLUSTER Of Finger print"))
self.assertFalse(one_cluster.__contains__("finger print for cluster"))