Skip to content

Conversation

@coder-jayp
Copy link

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

  • [ENH] - New feature (non-breaking change adding functionality)

How was this solved?

  • Created new class CatBoostCvExperiment in src/hyperactive/experiment/integrations/catboost_cv.py
  • Implemented _evaluate() to run catboost.cv() with fixed CV settings and dynamic hyperparameters
  • Added optional metric and loss_function parameters (with automatic custom_metric handling 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

  • PR title includes appropriate tag: [BUG], [ENH], [DOC] or [MNT]
  • Linked to related issue (if applicable)
  • Code passes make check (lint, format, isort)
  • 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

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] add CatBoostCvExperiment integration

1 participant