本文整理匯總了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"))