skfolio.utils.tools.check_estimator#

skfolio.utils.tools.check_estimator(estimator, default, check_type)[source]#

Check the estimator type and return its cloned version if provided, otherwise return the default estimator.

Parameters:
estimatorBaseEstimator | “passthrough”, optional

Estimator.

defaultBaseEstimator, optional

Default estimator to return when estimator is None.

check_typeAny

Expected type of the estimator to check against.

Returns:
estimatorEstimator | “passthrough”

The checked estimator or the default.