當前位置: 首頁>>代碼示例>>Python>>正文


Python TransformableRDD.clusters方法代碼示例

本文整理匯總了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"))
開發者ID:data-commons,項目名稱:prep-buddy,代碼行數:9,代碼來源:cluster_test.py

示例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"))
開發者ID:data-commons,項目名稱:prep-buddy,代碼行數:10,代碼來源:cluster_test.py

示例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"))
開發者ID:data-commons,項目名稱:prep-buddy,代碼行數:10,代碼來源:cluster_test.py


注:本文中的pyprepbuddy.rdds.transformable_rdd.TransformableRDD.clusters方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。