Hyperactive icon indicating copy to clipboard operation
Hyperactive copied to clipboard

[ENH] Add categorical feature encoding for GFO adapters

Open AdityaPandeyCN opened this issue 1 month ago • 1 comments

To Resolve #136 This PR adds automatic categorical feature handling for GFO-based optimizers by encoding non-numeric search space dimensions to consecutive integers internally, then decoding them back when evaluating the objective and returning results. Changes:

  1. Categorical dimensions (detected via dtype: object, unicode, string, boolean) are encoded to consecutive integers using np.unique
  2. Original category mappings are stored in _categorical_mappings for decoding
  3. Decoding happens transparently during objective evaluation and when returning best_params_
  4. Numeric dimensions are left unchanged
  5. Added capability:categorical tag with value "encoded" to _BaseGFOadapter
  6. Added test covering mixed numeric/categorical search spaces

AdityaPandeyCN avatar Nov 25 '25 16:11 AdityaPandeyCN

@fkiraly Please have a look, when time permits.

AdityaPandeyCN avatar Nov 26 '25 03:11 AdityaPandeyCN