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)What the rule reports
Section titled “What the rule reports”Calls to OptunaSearchCV with a literal 0 or negative max_iter.
How to fix it
Section titled “How to fix it”Pass a positive integer for max_iter (default 1000).
Diagnostic message
Section titled “Diagnostic message”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.