MCPcopy Index your code
hub / github.com/scikit-learn/scikit-learn / wrapper

Function wrapper

sklearn/base.py:1382–1403  ·  view source on GitHub ↗
(estimator, *args, **kwargs)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

get_configFunction · 0.90
_is_fittedFunction · 0.90
config_contextFunction · 0.90
_validate_paramsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…