Skip to content

optuna_integration/optuna-search-cv-nonpositive-max-iter

Pack Severity Fix Versions
Optuna Integration error none, edit by hand All versions

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

search = OptunaSearchCV(est, param_distributions, max_iter=0)
search = OptunaSearchCV(est, param_distributions, max_iter=100)

Calls to OptunaSearchCV with a literal 0 or negative max_iter.

Pass a positive integer for max_iter (default 1000).

OptunaSearchCV requires max_iter > 0 and raises ValueError for zero or negative max_iter. Pass a positive integer.

See all rules in the Optuna Integration pack.