Hyperactive icon indicating copy to clipboard operation
Hyperactive copied to clipboard

[ENH] for `gfo` allow `numpy` coercibles and/or `sklearn` parameter grids as search spaces

Open fkiraly opened this issue 7 months ago • 2 comments

The current gfo implementation allows to pass grid-like search spaces, similar to sklearn.

However, currently we cannot pass - but it would be desirable to:

  • values that are not np.ndarray-s, but coercible, i.e., 1D array-likes. If passed (e.g., lists), they get coerced to np.ndarray internally
  • union grids, such as in sklearn

More generally, it should not be too complicated to allow the full sklearn syntax to work - although coercion is probably much easier than supporting union grids.

fkiraly avatar May 24 '25 12:05 fkiraly

Hi @fkiraly I would like to take on this issue. Can you elaborate a bit on this?

amitsubhashchejara avatar Nov 17 '25 16:11 amitsubhashchejara

Hi @fkiraly , I'd like to work on this issue.

Proposed Approach

  1. Input Coercion

    • Update the internal handling of gfo inputs so that any array-like structure (e.g., Python lists, tuples) is automatically converted into a numpy.ndarray.
    • This ensures consistent downstream processing and aligns with the examples provided in the issue where a list currently causes unexpected behavior.
  2. Parameter Grid Handling

    • Add support for common scikit-learn grid formats ({"param": [values...]}) when compatible with the existing optimizer structure.
    • In cases where full scikit-learn union grids are not compatible, provide a clear and informative error message explaining the limitation.
    • Ensure that the behavior remains deterministic and compatible with existing grid search logic in Hyperactive. If this approach looks good, I would be happy to proceed with the implementation.

DCchoudhury15 avatar Nov 21 '25 18:11 DCchoudhury15