rules/optuna_integration/lightgbm-tuner-cv-regression-stratified.md

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.

diff
1-tuner = LightGBMTunerCV({"objective": "regression", "metric": "rmse"}, dtrain, nfold=5)
2+tuner = LightGBMTunerCV({"objective": "regression", "metric": "rmse"}, dtrain, nfold=5, stratified=False)

What the rule reports

Calls to LightGBMTunerCV with a literal regression objective in params that neither set stratified=False nor pass an explicit folds= splitter.

How to fix it

Pass stratified=False (or an explicit folds= cross-validation splitter such as KFold or TimeSeriesSplit).