mlresearch.utils.check_pipelines_wrapper

mlresearch.utils.check_pipelines_wrapper(*objects_list, wrapper, random_state, n_runs, estimator_param='classifier', wrapped_only=True)[source]

Extract estimators within a wrapper object and parameter grids to be passed to ModelSearchCV. This enables searching over any sequence of parameter settings and objects.

Parameters:
*objects_listsequence of lists

Lists of objects to be chained in a pipeline in the passed order. Each list must contain tuples composed of (<obj_name>, <object>, <parameter_values_dict>).

wrappertuple or tuple

Wrapper object to which the lists of objects will be passed. Must be structured as (<obj_name>, <object>, <parameter_values_dict>) and .

{random_state}
n_runsint

Number of initializations.

estimator_paramstr, default=”classifier”

Name of the parameter in the wrapper object where the estimators will be passed.

wrapped_onlybool, default=True

Return only the wrapped estimators. If False, returns both the wrapped and the original objects.

Returns:
wrapped_estimatorsList of Pipelines with all combinations among the passed lists

of objects.

wrapped_param_gridsList of dictionaries with estimator and parameter names

(str) as keys and lists of parameter settings to try as values.