估计器检查生成器#
- sklearn.utils.estimator_checks.estimator_checks_generator(estimator, *, legacy: bool = True, expected_failed_checks: dict[str, str] | None = None, mark: Literal['xfail', 'skip', None] = None)[source]#
- 迭代地为估计器生成所有检查函数。 - 版本 1.6 中新增。 - 参数:
- estimator估计器对象
- 用于生成检查的估计器实例。 
- legacybool, 默认值=True
- 是否包含旧版检查。随着时间的推移,我们将从这一类别中移除检查,并将它们移入其特定类别。 
- expected_failed_checksdict[str, str], 默认值=None
- 预期失败的检查的字典,格式为 {检查名称: 原因}。 
- mark{"xfail", "skip"} 或 None,默认值=None
- 是否将预期失败的检查标记为 xfail( - pytest.mark.xfail) 或 skip。通过将检查包装在一个引发- SkipTest异常的函数中来将测试标记为“skip”。
 
- 返回:
- estimator_checks_generator生成器
- 生成包含 (估计器, 检查) 元组的生成器。 
 
 
