当前位置: 首页>>代码示例>>Python>>正文


Python TransformableRDD.impute方法代码示例

本文整理汇总了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"))
开发者ID:blpabhishek,项目名称:prep-buddy,代码行数:15,代码来源:transformable_rdd_test.py

示例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"))
开发者ID:blpabhishek,项目名称:prep-buddy,代码行数:7,代码来源:transformable_rdd_test.py

示例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"))
开发者ID:blpabhishek,项目名称:prep-buddy,代码行数:7,代码来源:transformable_rdd_test.py


注:本文中的pyprepbuddy.rdds.transformable_rdd.TransformableRDD.impute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。