(
    directions: List[str],
    study_name: Optional[str] = None,
    storage: Optional[Union[str, BaseStorage]] = None,
    sampler: Optional["multi_objective.samplers.BaseMultiObjectiveSampler"] = None,
    load_if_exists: bool = False,
)
return MultiObjectiveStudy(study)
Create a new :class:`~optuna.multi_objective.study.MultiObjectiveStudy`.

    Example:

        .. testcode::

            import optuna


            def objective(trial):
                # Binh and Korn function.
                x = trial.suggest_float("x", 0, 5)
                y = trial.suggest_float("y", 0, 3)

                v0 = 4 * x ** 2 + 4 * y ** 2
                v1 = (x - 5) ** 2 + (y - 5) ** 2
                return v0, v1


            study = optuna.multi_objective.create_study(["minimize", "minimize"])
            study.optimize(objective, n_trials=3)

    Args:
        directions:
            Optimization direction for each objective value.
            Set ``minimize`` for minimization and ``maximize`` for maximization.
        study_name:
            Study's name. If this argument is set to None, a unique name is generated
            automatically.
        storage:
            Database URL. If this argument is set to None, in-memory storage is used, and the
            :class:`~optuna.study.Study` will not be persistent.

            .. note::
                When a database URL is passed, Optuna internally uses `SQLAlchemy`_ to handle
                the database. Please refer to `SQLAlchemy's document`_ for further details.
                If you want to specify non-default options to `SQLAlchemy Engine`_, you can
                instantiate :class:`~optuna.storages.RDBStorage` with your desired options and
                pass it to the ``storage`` argument instead of a URL.

             .. _SQLAlchemy: https://www.sqlalchemy.org/
             .. _SQLAlchemy's document:
                 https://docs.sqlalchemy.org/en/latest/core/engines.html#database-urls
             .. _SQLAlchemy Engine: https://docs.sqlalchemy.org/en/latest/core/engines.html

        sampler:
            A sampler object that implements background algorithm for value suggestion.
            If :obj:`None` is specified,
            :class:`~optuna.multi_objective.samplers.NSGAIIMultiObjectiveSampler` is used
            as the default. See also :class:`~optuna.multi_objective.samplers`.
        load_if_exists:
            Flag to control the behavior to handle a conflict of study names.
            In the case where a study named ``study_name`` already exists in the ``storage``,
            a :class:`~optuna.exceptions.DuplicatedStudyError` is raised if ``load_if_exists`` is
            set to :obj:`False`.
            Otherwise, the creation of the study is skipped, and the existing one is returned.

    Returns:
        A :class:`~optuna.multi_objective.study.MultiObjectiveStudy` object.
Create a new :class:`~optuna.multi_objective.study.MultiObjectiveStudy`.
Create a new : class : ~optuna . multi_objective . study . MultiObjectiveStudy .
def create_study(
    directions: List[str],
    study_name: Optional[str] = None,
    storage: Optional[Union[str, BaseStorage]] = None,
    sampler: Optional["multi_objective.samplers.BaseMultiObjectiveSampler"] = None,
    load_if_exists: bool = False,
) -> "multi_objective.study.MultiObjectiveStudy":
    """Create a new :class:`~optuna.multi_objective.study.MultiObjectiveStudy`.

    Example:

        .. testcode::

            import optuna


            def objective(trial):
                # Binh and Korn function.
                x = trial.suggest_float("x", 0, 5)
                y = trial.suggest_float("y", 0, 3)

                v0 = 4 * x ** 2 + 4 * y ** 2
                v1 = (x - 5) ** 2 + (y - 5) ** 2
                return v0, v1


            study = optuna.multi_objective.create_study(["minimize", "minimize"])
            study.optimize(objective, n_trials=3)

    Args:
        directions:
            Optimization direction for each objective value.
            Set ``minimize`` for minimization and ``maximize`` for maximization.
        study_name:
            Study's name. If this argument is set to None, a unique name is generated
            automatically.
        storage:
            Database URL. If this argument is set to None, in-memory storage is used, and the
            :class:`~optuna.study.Study` will not be persistent.

            .. note::
                When a database URL is passed, Optuna internally uses `SQLAlchemy`_ to handle
                the database. Please refer to `SQLAlchemy's document`_ for further details.
                If you want to specify non-default options to `SQLAlchemy Engine`_, you can
                instantiate :class:`~optuna.storages.RDBStorage` with your desired options and
                pass it to the ``storage`` argument instead of a URL.

             .. _SQLAlchemy: https://www.sqlalchemy.org/
             .. _SQLAlchemy's document:
                 https://docs.sqlalchemy.org/en/latest/core/engines.html#database-urls
             .. _SQLAlchemy Engine: https://docs.sqlalchemy.org/en/latest/core/engines.html

        sampler:
            A sampler object that implements background algorithm for value suggestion.
            If :obj:`None` is specified,
            :class:`~optuna.multi_objective.samplers.NSGAIIMultiObjectiveSampler` is used
            as the default. See also :class:`~optuna.multi_objective.samplers`.
        load_if_exists:
            Flag to control the behavior to handle a conflict of study names.
            In the case where a study named ``study_name`` already exists in the ``storage``,
            a :class:`~optuna.exceptions.DuplicatedStudyError` is raised if ``load_if_exists`` is
            set to :obj:`False`.
            Otherwise, the creation of the study is skipped, and the existing one is returned.

    Returns:
        A :class:`~optuna.multi_objective.study.MultiObjectiveStudy` object.
    """

    # TODO(ohta): Support pruner.
    mo_sampler = sampler or multi_objective.samplers.NSGAIIMultiObjectiveSampler()
    sampler_adapter = multi_objective.samplers._MultiObjectiveSamplerAdapter(mo_sampler)

    if not isinstance(directions, Iterable):
        raise TypeError("`directions` must be a list or other iterable types.")

    if not all(d in ["minimize", "maximize"] for d in directions):
        raise ValueError("`directions` includes unknown direction names.")

    study = _create_study(
        study_name=study_name,
        storage=storage,
        sampler=sampler_adapter,
        pruner=NopPruner(),
        load_if_exists=load_if_exists,
    )

    study.set_system_attr("multi_objective:study:directions", list(directions))

    return MultiObjectiveStudy(study)
def create_study ( directions : List [ str ] , study_name : Optional [ str ] = None , storage : Optional [ Union [ str , BaseStorage ] ] = None , sampler : Optional [ "multi_objective.samplers.BaseMultiObjectiveSampler" ] = None , load_if_exists : bool = False , ) -> "multi_objective.study.MultiObjectiveStudy" : # TODO(ohta): Support pruner. mo_sampler = sampler or multi_objective . samplers . NSGAIIMultiObjectiveSampler ( ) sampler_adapter = multi_objective . samplers . _MultiObjectiveSamplerAdapter ( mo_sampler ) if not isinstance ( directions , Iterable ) : raise TypeError ( "`directions` must be a list or other iterable types." ) if not all ( d in [ "minimize" , "maximize" ] for d in directions ) : raise ValueError ( "`directions` includes unknown direction names." ) study = _create_study ( study_name = study_name , storage = storage , sampler = sampler_adapter , pruner = NopPruner ( ) , load_if_exists = load_if_exists , ) study . set_system_attr ( "multi_objective:study:directions" , list ( directions ) ) return MultiObjectiveStudy ( study )