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)[原始碼]#

為估計器迭代產生所有檢查可呼叫物件。

在 1.6 版中新增。

參數:
estimator估計器物件

要產生檢查的估計器實例。

legacybool,預設值為 True

是否包含傳統檢查。隨著時間的推移,我們會從此類別中移除檢查,並將其移至其特定類別中。

expected_failed_checksdict[str, str],預設值為 None

預期會失敗的檢查的 {check_name: reason} 形式的字典。

mark{“xfail”, “skip”} 或 None,預設值為 None

是否將預期會失敗的檢查標記為 xfail(pytest.mark.xfail)或跳過。將測試標記為「跳過」是透過將檢查包裝在會引發 SkipTest 例外狀況的函數中來完成的。

傳回值:
estimator_checks_generator產生器

產生 (估計器、檢查) 元組的產生器。