mlresearch.utils.check_pipelines

mlresearch.utils.check_pipelines(*objects_list, random_state, n_runs)[source]

Extract estimators 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>).

random_stateint, RandomState instance, default=None

Control the randomization of the algorithm.

  • If int, random_state is the seed used by the random number generator;

  • If RandomState instance, random_state is the random number generator;

  • If None, the random number generator is the RandomState instance used by np.random.

n_runsint

Number of initializations.

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

objects.

param_gridsList of dictionaries with estimator and parameter names (str) as

keys and lists of parameter settings to try as values.