The Optuna Integration pack checks OptunaSearchCV, LightGBMTuner, LightGBMTunerCV, and deprecated integration classes in files that use optuna_integration or optuna.integration. Optuna Integration 5.1
| Rules |
Safe fix |
Unsafe fix |
Manual fix |
| 7 |
0 |
0 |
7 |
| Rule |
Severity |
Fix |
What it finds |
| deprecated-integration-classes |
warning |
none |
optuna-integration 5.1 marks PyCmaSampler, MLflowCallback, WeightsAndBiasesCallback, TensorBoardCallback, CometCallback, TrackioCallback, and TensorFlowPruningHook with @deprecated_class for removal in 6.0. |
| Rule |
Severity |
Fix |
What it finds |
| lightgbm-tuner-missing-valid-sets |
error |
none |
LightGBMTuner raises ValueError("valid_sets is required.") at initialization when valid_sets is omitted or None. |
| lightgbm-tuner-deprecated-feature-args |
warning |
none |
LightGBMTuner and LightGBMTunerCV emit a deprecation UserWarning when feature_name= or categorical_feature= is passed, because LightGBM 4.6 removed those parameters from lgb.train and lgb.cv. |
| lightgbm-tuner-cv-regression-stratified |
error |
none |
LightGBMTunerCV defaults to stratified=True, so running it with a regression objective passes continuous targets to StratifiedKFold inside lightgbm.cv and fails every trial with ValueError. |
| Rule |
Severity |
Fix |
What it finds |
| optuna-search-cv-deprecated-distributions |
error |
none |
OptunaSearchCV.fit() explicitly rejects deprecated Optuna distributions (UniformDistribution, LogUniformDistribution, DiscreteUniformDistribution, IntUniformDistribution, and IntLogUniformDistribution) with ValueError. |
| optuna-search-cv-missing-groups |
error |
none |
Group-aware splitters need a group label for each row. |
| optuna-search-cv-nonpositive-max-iter |
error |
none |
OptunaSearchCV.fit() validates max_iter > 0 and raises ValueError("max_iter must be > 0") when max_iter is 0 or negative. |