本文整理汇总了Python中pml.data.model.DataSet.fill_missing_with_feature_means方法的典型用法代码示例。如果您正苦于以下问题:Python DataSet.fill_missing_with_feature_means方法的具体用法?Python DataSet.fill_missing_with_feature_means怎么用?Python DataSet.fill_missing_with_feature_means使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pml.data.model.DataSet
的用法示例。
在下文中一共展示了DataSet.fill_missing_with_feature_means方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_fill_missing_with_feature_means_feature_all_empty
# 需要导入模块: from pml.data.model import DataSet [as 别名]
# 或者: from pml.data.model.DataSet import fill_missing_with_feature_means [as 别名]
def test_fill_missing_with_feature_means_feature_all_empty(self):
dataset = DataSet([[2, np.NaN, np.NaN], [7, np.NaN, 10],
[5, np.NaN, np.NaN]])
dataset.fill_missing_with_feature_means()
assert_that(dataset, equals_dataset([[2, 0, 10], [7, 0, 10],
[5, 0, 10]]))
示例2: test_fill_missing_with_feature_means
# 需要导入模块: from pml.data.model import DataSet [as 别名]
# 或者: from pml.data.model.DataSet import fill_missing_with_feature_means [as 别名]
def test_fill_missing_with_feature_means(self):
dataset = DataSet([[2, np.NaN, np.NaN], [np.NaN, 6, 10],
[5, 4, np.NaN]])
dataset.fill_missing_with_feature_means()
assert_that(dataset, equals_dataset([[2, 5, 10], [3.5, 6, 10],
[5, 4, 10]]))