本文整理汇总了Python中sklearn.impute.SimpleImputer.__repr__方法的典型用法代码示例。如果您正苦于以下问题:Python SimpleImputer.__repr__方法的具体用法?Python SimpleImputer.__repr__怎么用?Python SimpleImputer.__repr__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sklearn.impute.SimpleImputer
的用法示例。
在下文中一共展示了SimpleImputer.__repr__方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_changed_only
# 需要导入模块: from sklearn.impute import SimpleImputer [as 别名]
# 或者: from sklearn.impute.SimpleImputer import __repr__ [as 别名]
def test_changed_only():
# Make sure the changed_only param is correctly used
set_config(print_changed_only=True)
lr = LogisticRegression(C=99)
expected = """LogisticRegression(C=99)"""
assert lr.__repr__() == expected
# Check with a repr that doesn't fit on a single line
lr = LogisticRegression(C=99, class_weight=.4, fit_intercept=False,
tol=1234, verbose=True)
expected = """
LogisticRegression(C=99, class_weight=0.4, fit_intercept=False, tol=1234,
verbose=True)"""
expected = expected[1:] # remove first \n
assert lr.__repr__() == expected
imputer = SimpleImputer(missing_values=0)
expected = """SimpleImputer(missing_values=0)"""
assert imputer.__repr__() == expected
# Defaults to np.NaN, trying with float('NaN')
imputer = SimpleImputer(missing_values=float('NaN'))
expected = """SimpleImputer()"""
assert imputer.__repr__() == expected
set_config(print_changed_only=False)