rules/optuna_integration/optuna-search-cv-nonpositive-max-iter.md

OptunaSearchCV.fit() validates max_iter > 0 and raises ValueError("max_iter must be > 0") when max_iter is 0 or negative.

diff
1-search = OptunaSearchCV(est, param_distributions, max_iter=0)
2+search = OptunaSearchCV(est, param_distributions, max_iter=100)

What the rule reports

Calls to OptunaSearchCV with a literal 0 or negative max_iter.

How to fix it

Pass a positive integer for max_iter (default 1000).