Hyperactive
Hyperactive copied to clipboard
[Feature] Add CatBoostCvExperiment integration (#229)
Description
Adds a new CatBoostCvExperiment integration that allows Hyperactive to perform cross-validation directly using CatBoost's native catboost.cv() function.
This enables efficient hyperparameter tuning for CatBoost models with built-in CV.
Related Issues
Closes #229
Type of Change
- [x]
[ENH]- New feature (non-breaking change adding functionality)
How was this solved?
- Created new class
CatBoostCvExperimentinsrc/hyperactive/experiment/integrations/catboost_cv.py - Implemented
_evaluate()to runcatboost.cv()with fixed CV settings and dynamic hyperparameters - Added optional
metricandloss_functionparameters (with automaticcustom_metrichandling when they differ) - Set direction tag to "lower" (CatBoost objectives are minimization)
- Added CatBoostCvExperiment to init.py exports
- Added two pytest tests in
src/hyperactive/tests/test_integrations/test_catboost_cv.py:- Basic Logloss run
- AUC metric with Logloss objective (verifies metric/loss separation)
Checklist
- [x] PR title includes appropriate tag:
[BUG],[ENH],[DOC]or[MNT] - [x] Linked to related issue (if applicable)
- [ ] Code passes
make check(lint, format, isort) - [x] Tests added/updated for changes (if applicable)
- [ ] Documentation updated (if applicable)
Testing
Run the integration tests (verbose mode recommended):
pytest src/hyperactive/tests/test_integrations/test_catboost_cv.py -v
@SimonBlanke, it would be great to get some feedback. Thanks.
Hi @SimonBlanke, could you please review my PR?