diff --git a/docs/source/reference/terminator.rst b/docs/source/reference/terminator.rst index 3a4d626fa9..08d5680572 100644 --- a/docs/source/reference/terminator.rst +++ b/docs/source/reference/terminator.rst @@ -9,5 +9,5 @@ The :mod:`~optuna.terminator` module implements a mechanism for automatically te :toctree: generated/ :nosignatures: - optuna.terminator.terminator.Terminator - optuna.terminator.callback.TerminatorCallback \ No newline at end of file + optuna.terminator.Terminator + optuna.terminator.TerminatorCallback \ No newline at end of file diff --git a/optuna/terminator/callback.py b/optuna/terminator/callback.py index 209a51f197..7e549de85d 100644 --- a/optuna/terminator/callback.py +++ b/optuna/terminator/callback.py @@ -15,14 +15,14 @@ class TerminatorCallback: """A callback that terminates the optimization using Terminator. - This class implements a callback which wraps :class:`~optuna.terminator.terminator.Terminator` + This class implements a callback which wraps :class:`~optuna.terminator.Terminator` so that it can be used with the :func:`~optuna.study.Study.optimize` method. Args: terminator: A terminator object which determines whether to terminate the optimization by assessing the room for optimization and statistical error. Defaults to a - :class:`~optuna.terminator.terminator.Terminator` object with default + :class:`~optuna.terminator.Terminator` object with default improvement_evaluator and error_evaluator. Example: @@ -35,8 +35,8 @@ class TerminatorCallback: from sklearn.model_selection import KFold import optuna - from optuna.terminator.callback import TerminatorCallback - from optuna.terminator.erroreval import report_cross_validation_scores + from optuna.terminator import TerminatorCallback + from optuna.terminator import report_cross_validation_scores def objective(trial): @@ -58,7 +58,7 @@ def objective(trial): study.optimize(objective, n_trials=50, callbacks=[terminator]) .. seealso:: - Please refer to :class:`~optuna.terminator.terminator.Terminator` for the details of + Please refer to :class:`~optuna.terminator.Terminator` for the details of the terminator mechanism. """ diff --git a/optuna/terminator/terminator.py b/optuna/terminator/terminator.py index 0f63845a73..fd95dc1e84 100644 --- a/optuna/terminator/terminator.py +++ b/optuna/terminator/terminator.py @@ -36,7 +36,7 @@ class Terminator(BaseTerminator): :class:`~optuna.terminator.improvement.evaluator.RegretBoundEvaluator` object. error_evaluator: An evaluator for calculating the statistical error, e.g. cross-validation error. - Defaults to a :class:`~optuna.terminator.erroreval.CrossValidationErrorEvaluator` + Defaults to a :class:`~optuna.terminator.CrossValidationErrorEvaluator` object. min_n_trials: The minimum number of trials before termination is considered. Defaults to ``20``. @@ -57,8 +57,8 @@ class Terminator(BaseTerminator): from sklearn.model_selection import KFold import optuna - from optuna.terminator.terminator import Terminator - from optuna.terminator.erroreval import report_cross_validation_scores + from optuna.terminator import Terminator + from optuna.terminator import report_cross_validation_scores study = optuna.create_study(direction="maximize") @@ -88,7 +88,7 @@ class Terminator(BaseTerminator): break .. seealso:: - Please refer to :class:`~optuna.terminator.callbacks.TerminationCallback` for how to use + Please refer to :class:`~optuna.terminator.TerminationCallback` for how to use the terminator mechanism with the :func:`~optuna.study.Study.optimize` method. """