plot_terminator_improvement

optuna.visualization.plot_terminator_improvement(study, plot_error=False, improvement_evaluator=None, error_evaluator=None, min_n_trials=20)[源代码]

绘制未来目标改进的潜力。

此函数可视化使用 improvement_evaluator 评估的目标改进潜力。它有助于确定是否应继续优化。如果将 plot_error 参数设置为 True,您还可以绘制使用 error_evaluator 评估的误差。请注意,此函数可能需要一些时间来计算改进潜力。

参数:
  • study (Study) – 一个 Study 对象,其试验将被绘制以显示其改进情况。

  • plot_error (bool) – 一个用于显示误差的标志。如果将其设置为 True,还会将由 error_evaluator 评估的误差绘制成折线图。默认为 False

  • improvement_evaluator (BaseImprovementEvaluator | None) – 一个用于评估目标函数改进的对象。默认为 RegretBoundEvaluator

  • error_evaluator (BaseErrorEvaluator | None) – 一个用于评估目标函数固有的误差的对象。默认为 CrossValidationErrorEvaluator

  • min_n_trials (int) – 在考虑终止之前所需的最小试验数。低于此值的试验的终止器改进将显示为较浅的颜色。默认为 20

返回:

一个 plotly.graph_objects.Figure 对象。

返回类型:

Figure

注意

在 v3.2.0 中添加为实验性功能。接口可能在更高版本中更改,恕不另行通知。请参阅 https://github.com/optuna/optuna/releases/tag/v3.2.0

以下代码片段展示了如何绘制改进潜力以及交叉验证误差。

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/sklearn/utils/validation.py:2749: UserWarning:

X does not have valid feature names, but LGBMClassifier was fitted with feature names

/home/docs/checkouts/readthedocs.org/user_builds/optuna/checkouts/stable/docs/visualization_examples/optuna.visualization.plot_terminator_improvement.py:42: ExperimentalWarning:

optuna.visualization._terminator_improvement.plot_terminator_improvement is experimental (supported from v3.2.0). The interface can change in the future.

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/optuna/visualization/_terminator_improvement.py:93: ExperimentalWarning:

RegretBoundEvaluator is experimental (supported from v3.2.0). The interface can change in the future.

/home/docs/checkouts/readthedocs.org/user_builds/optuna/envs/stable/lib/python3.12/site-packages/optuna/visualization/_terminator_improvement.py:98: ExperimentalWarning:

CrossValidationErrorEvaluator is experimental (supported from v3.2.0). The interface can change in the future.


  0%|          | 0/30 [00:00<?, ?it/s]
 17%|█▋        | 5/30 [00:00<00:00, 49.39it/s]
 47%|████▋     | 14/30 [00:00<00:00, 68.79it/s]
 73%|███████▎  | 22/30 [00:00<00:00, 70.70it/s]
100%|██████████| 30/30 [00:00<00:00, 71.17it/s]
100%|██████████| 30/30 [00:00<00:00, 69.23it/s]

from lightgbm import LGBMClassifier
from sklearn.datasets import load_wine
from sklearn.model_selection import cross_val_score
from sklearn.model_selection import KFold
import optuna
from plotly.io import show
from optuna.terminator import report_cross_validation_scores
from optuna.visualization import plot_terminator_improvement


def objective(trial):
    X, y = load_wine(return_X_y=True)
    clf = LGBMClassifier(
        reg_alpha=trial.suggest_float("reg_alpha", 1e-8, 10.0, log=True),
        reg_lambda=trial.suggest_float("reg_lambda", 1e-8, 10.0, log=True),
        num_leaves=trial.suggest_int("num_leaves", 2, 256),
        colsample_bytree=trial.suggest_float("colsample_bytree", 0.4, 1.0),
        subsample=trial.suggest_float("subsample", 0.4, 1.0),
        subsample_freq=trial.suggest_int("subsample_freq", 1, 7),
        min_child_samples=trial.suggest_int("min_child_samples", 5, 100),
    )
    scores = cross_val_score(clf, X, y, cv=KFold(n_splits=5, shuffle=True))
    report_cross_validation_scores(trial, scores)
    return scores.mean()


study = optuna.create_study()
study.optimize(objective, n_trials=30)

fig = plot_terminator_improvement(study, plot_error=True)
show(fig)

脚本总运行时间: (0 分钟 1.792 秒)

由 Sphinx-Gallery 生成的画廊