Skip to content

Conversation

@AdityaPandeyCN
Copy link

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

Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
Signed-off-by: AdityaPandeyCN <adityapand3y666@gmail.com>
@AdityaPandeyCN
Copy link
Author

AdityaPandeyCN commented Nov 26, 2025

@fkiraly Please have a look, when time permits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENH] handling of categorical features and sensible defaults

1 participant