本文整理汇总了Python中pyprepbuddy.rdds.transformable_rdd.TransformableRDD.impute方法的典型用法代码示例。如果您正苦于以下问题:Python TransformableRDD.impute方法的具体用法?Python TransformableRDD.impute怎么用?Python TransformableRDD.impute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyprepbuddy.rdds.transformable_rdd.TransformableRDD
的用法示例。
在下文中一共展示了TransformableRDD.impute方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_transformableRDD_can_impute_the_missing_values_by_NaiveBayesSubstitution
# 需要导入模块: from pyprepbuddy.rdds.transformable_rdd import TransformableRDD [as 别名]
# 或者: from pyprepbuddy.rdds.transformable_rdd.TransformableRDD import impute [as 别名]
def test_transformableRDD_can_impute_the_missing_values_by_NaiveBayesSubstitution(self):
rdd = self.sc.parallelize(["Drew,No,Blue,Short,Male",
"Claudia,Yes,Brown,Long,Female",
"Drew,No,Blue,Long,Female",
"Drew,No,Blue,Long,Female",
"Alberto,Yes,Brown,Short,Male",
"Karin,No,Blue,Long,Female",
"Nina,Yes,Brown,Short,Female",
"Sergio,Yes,Blue,Long,Male",
"Drew,Yes,Blue,Long,"])
transformable_rdd = TransformableRDD(rdd, 'csv')
imputed_rdd = transformable_rdd.impute(4, NaiveBayesSubstitution(0, 1, 2, 3))
self.assertTrue(imputed_rdd.collect().__contains__("Drew,Yes,Blue,Long,Female"))
示例2: test_transformableRDD_can_impute_the_missing_values_by_UnivariateLinearRegressionSubstitution
# 需要导入模块: from pyprepbuddy.rdds.transformable_rdd import TransformableRDD [as 别名]
# 或者: from pyprepbuddy.rdds.transformable_rdd.TransformableRDD import impute [as 别名]
def test_transformableRDD_can_impute_the_missing_values_by_UnivariateLinearRegressionSubstitution(self):
rdd = self.sc.parallelize(["60,3.1", "61,3.6", "62,3.8", "63,4", "65,4.1", "64,"])
transformable_rdd = TransformableRDD(rdd, 'csv')
imputed_rdd = transformable_rdd.impute(1, UnivariateLinearRegressionSubstitution(0))
self.assertTrue(imputed_rdd.collect().__contains__("64,4.06"))
示例3: test_transformableRDD_can_impute_the_missing_values_by_ApproxMeanSubstitution
# 需要导入模块: from pyprepbuddy.rdds.transformable_rdd import TransformableRDD [as 别名]
# 或者: from pyprepbuddy.rdds.transformable_rdd.TransformableRDD import impute [as 别名]
def test_transformableRDD_can_impute_the_missing_values_by_ApproxMeanSubstitution(self):
rdd = self.sc.parallelize(["Ram,9", "Joe,45", "Jill,45", "Soa,"])
transformable_rdd = TransformableRDD(rdd, 'csv')
imputed_rdd = transformable_rdd.impute(1, ApproxMeanSubstitution())
self.assertTrue(imputed_rdd.collect().__contains__("Soa,33.0"))