You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(validation): Add generic parameter filtering and optional XGBoost support
This commit significantly refactors the parameter validation logic to be more robust and flexible.
Key changes:
- **Generic Parameter Filtering**: `validate_parameters_helper` now includes a generic fallback mechanism. It inspects the `algorithm_implementation` using `get_params()` and removes any keys from the parameter space that are not valid for that specific model. This prevents `TypeError` exceptions during hyperparameter search when a parameter space contains keys not recognized by the estimator.
- **Optional XGBoost**: The import of `XGBClassifier` has been moved inside a `try...except` block. This makes `xgboost` an optional dependency, allowing the library to run without it installed.
- **Improved Type Checking**: Added `isinstance(..., list)` checks in `validate_knn_parameters` and `validate_XGB_parameters` to prevent errors when parameter values are not lists as expected.
- **Cleanup**: Minor whitespace removal in `tests/conftest.py`.
0 commit comments