estimator_checks_generator#
- 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 = None)[source]#
迭代生成一个估计器的所有可调用检查。
在 1.6 版本中添加。
- 参数:
- estimator估计器对象
用于生成检查的估计器实例。
- legacy布尔值,默认值=True
是否包含遗留检查。随着时间的推移,我们将从这个类别中移除检查并将其移动到其特定类别。
- expected_failed_checks字典[str, str],默认值=None
格式为 {check_name: reason} 的字典,用于预期会失败的检查。
- mark{"xfail", "skip"} 或 None,默认值=None
是否将预期会失败的检查标记为 xfail(
pytest.mark.xfail
) 或跳过 (skip)。将测试标记为“skip”是通过将检查封装在一个会引发SkipTest
异常的函数中实现的。
- 返回:
- estimator_checks_generator生成器
生成 (estimator, check) 元组的生成器。