Skip to content

Conversation

@fkiraly
Copy link
Collaborator

@fkiraly fkiraly commented Aug 13, 2025

This PR introduces parallelization backends for GridSearch and RandomSearch.

Both estimators now allow to specify backend and backend_params in the constructor, which allows selection of a parallelization backend and configuration parameters for it - the default being "None", i.e., plain loop.

This uses the parallel utilities also used in sktime and skpro, with a mid-term plan to move these to scikit-base.

@fkiraly fkiraly added the enhancement New feature or request label Aug 13, 2025
Directly passed to ``utils.parallel.parallelize``.
Valid keys depend on the value of ``backend``:
- "None": no additional parameters, ``backend_params`` is ignored
Copy link
Collaborator

@SimonBlanke SimonBlanke Aug 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read through the backend_params multiple times and I do not understand how they work. How does the key and value of the dict look like?
We also have two parameters "backend" and "backend_params", that could easily be done in one parameter.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

backend selects which parellization backend you want to use, e.g., "joblib" or `"ray".

backend_params is a config dict for the backend, which keys you can pass depends on the chosen backend.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the docstrings, hope that is clearer now?

Copy link
Collaborator

@SimonBlanke SimonBlanke Aug 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does the key and value of the dict look like? Does the dict have multiple keys? Is the value a list of the strings shown in the docstring text or just one string? Could you write an example into the docstring?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the params dict can be a dict with multiple keys, I will add an example

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added example

@fkiraly fkiraly changed the title [ENH} parallelization backends for grid and random search [ENH] parallelization backends for grid and random search Aug 14, 2025
@fkiraly fkiraly added this to the v5.0 milestone Aug 15, 2025
Copy link
Collaborator

@SimonBlanke SimonBlanke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolve conflicts

Copy link
Collaborator

@SimonBlanke SimonBlanke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix tests before merge can be done

@SimonBlanke SimonBlanke merged commit f663313 into hyperactive-project:master Aug 17, 2025
40 checks passed
SimonBlanke added a commit that referenced this pull request Aug 17, 2025
From Original PR #150:

This PR introduces parallelization backends for GridSearch and
RandomSearch.

Both estimators now allow to specify backend and backend_params in the
constructor, which allows selection of a parallelization backend and
configuration parameters for it - the default being "None", i.e., plain
loop.

This uses the parallel utilities also used in sktime and skpro, with a
mid-term plan to move these to scikit-base.

---------

Co-authored-by: Franz Király <fkiraly@gcos.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants