(estimator, *args, **kwargs)
| 1380 | def decorator(fit_method): |
| 1381 | @functools.wraps(fit_method) |
| 1382 | def wrapper(estimator, *args, **kwargs): |
| 1383 | from sklearn.callback._callback_support import callback_management_context |
| 1384 | |
| 1385 | global_skip_validation = get_config()["skip_parameter_validation"] |
| 1386 | |
| 1387 | # we don't want to validate again for each call to partial_fit |
| 1388 | partial_fit_and_fitted = ( |
| 1389 | fit_method.__name__ == "partial_fit" and _is_fitted(estimator) |
| 1390 | ) |
| 1391 | |
| 1392 | if not global_skip_validation and not partial_fit_and_fitted: |
| 1393 | estimator._validate_params() |
| 1394 | |
| 1395 | with ( |
| 1396 | config_context( |
| 1397 | skip_parameter_validation=( |
| 1398 | prefer_skip_nested_validation or global_skip_validation |
| 1399 | ) |
| 1400 | ), |
| 1401 | callback_management_context(estimator), |
| 1402 | ): |
| 1403 | return fit_method(estimator, *args, **kwargs) |
| 1404 | |
| 1405 | return wrapper |
| 1406 |
nothing calls this directly
no test coverage detected
searching dependent graphs…