and running tests continue. - None: No exception is raised and no warning is logged. Note that if ``on_fail != "raise"``, no exception is raised, even if the checks fail. You'd need to inspect the return result of ``check_estimator`` to check if any checks failed. .. versionadded:: 1.6 callback : callable, or None, default=None This callback will be called with the estimator and the check name, the exception (if any), the status of the check (xfail, failed, skipped, passed), and the reason for the expected failure if the check is expected to fail. The callable's signature needs to be:: def callback( estimator, check_name: str, exception: Exception, status: Literal["xfail", "failed", "skipped", "passed"], expected_to_fail: bool, expected_to_fail_reason: str, ) ``callback`` cannot be provided together with ``on_fail="raise"``. .. versionadded:: 1.6 Returns ------- test_results : list List of dictionaries with the results of the failing tests, of the form:: { "estimator": estimator, "check_name": check_name, "exception": exception, "status": status (one of "xfail", "failed", "skipped", "passed"), "expected_to_fail": expected_to_fail, "expected_to_fail_reason": expected_to_fail_reason, } estimator_checks_generator : generator Generator that yields (estimator, check) tuples. Returned when `generate_only=True`. .. TODO(1.8): remove return value .. deprecated:: 1.6 ``generate_only`` will be removed in 1.8. Use :func:`~sklearn.utils.estimator_checks.estimator_checks_generator` instead. Raises ------ Exception If ``on_fail="raise"``, the exception raised by the first failing check is raised and running tests are aborted. Note that if ``on_fail != "raise"``, no exception is raised, even if the checks fail. You'd need to inspect the return result of ``check_estimator`` to check if any checks failed. See Also -------- parametrize_with_checks : Pytest specific decorator for parametrizing estimator checks. estimator_checks_generator : Generator that yields (estimator, check) tuples. Examples -------- >>> from sklearn.utils.estimator_checks import check_estimator >>> from sklearn.linear_model import LogisticRegression >>> check_estimator(LogisticRegression()) [...] r<