class_docstr: Multi-objective sampler using the MOTPE algorithm.
  
  This sampler is a multi-objective version of :class:`~optuna.samplers.TPESampler`.
  
  .. note::
      For `v2.4.0 <https://github.com/optuna/optuna/releases/tag/v2.4.0>`_ or later,
      :class:`~optuna.multi_objective.samplers.MOTPEMultiObjectiveSampler` is deprecated and
      :class:`~optuna.samplers.TPESampler` should be used instead. The following code shows how
      you apply :class:`~optuna.samplers.TPESampler` to a multi-objective task:
  
      .. testcode::
  
          import optuna
  
  
          def objective(trial):
              x = trial.suggest_float("x", -100, 100)
              y = trial.suggest_categorical("y", [-1, 0, 1])
              f1 = x**2 + y
              f2 = -((x - 2) ** 2 + y)
              return f1, f2
  
  
          # We minimize the first objective and maximize the second objective.
          sampler = optuna.samplers.TPESampler()
          study = optuna.create_study(directions=["minimize", "maximize"], sampler=sampler)
          study.optimize(objective, n_trials=100)
  
  For further information about MOTPE algorithm, please refer to the following papers:
  
  - `Multiobjective tree-structured parzen estimator for computationally expensive optimization
    problems <https://dl.acm.org/doi/abs/10.1145/3377930.3389817>`_
  - `Multiobjective Tree-Structured Parzen Estimator <https://doi.org/10.1613/jair.1.13188>`_
  
  Args:
      consider_prior:
          Enhance the stability of Parzen estimator by imposing a Gaussian prior when
          :obj:`True`. The prior is only effective if the sampling distribution is
          either :class:`~optuna.distributions.FloatDistribution`,
          or :class:`~optuna.distributions.IntDistribution`.
      prior_weight:
          The weight of the prior. This argument is used in
          :class:`~optuna.distributions.FloatDistribution`,
          :class:`~optuna.distributions.IntDistribution`, and
          :class:`~optuna.distributions.CategoricalDistribution`.
      consider_magic_clip:
          Enable a heuristic to limit the smallest variances of Gaussians used in
          the Parzen estimator.
      consider_endpoints:
          Take endpoints of domains into account when calculating variances of Gaussians
          in Parzen estimator. See the original paper for details on the heuristics
          to calculate the variances.
      n_startup_trials:
          The random sampling is used instead of the MOTPE algorithm until the given number
          of trials finish in the same study. 11 * number of variables - 1 is recommended in the
          original paper.
      n_ehvi_candidates:
          Number of candidate samples used to calculate the expected hypervolume improvement.
      gamma:
          A function that takes the number of finished trials and returns the number of trials to
          form a density function for samples with low grains. See the original paper for more
          details.
      weights_above:
          A function that takes the number of finished trials and returns a weight for them. As
          default, weights are automatically calculated by the MOTPE's default strategy.
      seed:
          Seed for random number generator.
  
  .. note::
      Initialization with Latin hypercube sampling may improve optimization performance.
      However, the current implementation only supports initialization with random sampling.
  
  Example:
  
      .. testcode::
  
          import optuna
  
          seed = 128
          num_variables = 9
          n_startup_trials = 11 * num_variables - 1
  
  
          def objective(trial):
              x = []
              for i in range(1, num_variables + 1):
                  x.append(trial.suggest_float(f"x{i}", 0.0, 2.0 * i))
              return x
  
  
          sampler = optuna.multi_objective.samplers.MOTPEMultiObjectiveSampler(
              n_startup_trials=n_startup_trials, n_ehvi_candidates=24, seed=seed
          )
          study = optuna.multi_objective.create_study(
              ["minimize"] * num_variables, sampler=sampler
          )
          study.optimize(objective, n_trials=250)
class_docstr_tok: ["Multi-objective","sampler","using","the","MOTPE","algorithm",".","This","sampler","is","a","multi-objective","version","of",":","class",":","`","~optuna.samplers.TPESampler","`",".","..","note",":",":","For","`","v2.4.0","<","https",":","\/\/github.com\/optuna\/optuna\/releases\/tag\/v2.4.0",">","`","_","or","later",",",":","class",":","`","~optuna.multi_objective.samplers.MOTPEMultiObjectiveSampler","`","is","deprecated","and",":","class",":","`","~optuna.samplers.TPESampler","`","should","be","used","instead",".","The","following","code","shows","how","you","apply",":","class",":","`","~optuna.samplers.TPESampler","`","to","a","multi-objective","task",":","..","testcode",":",":","import","optuna","def","objective","(","trial",")",":","x","=","trial.suggest_float","(","``","x","''",",","-100",",","100",")","y","=","trial.suggest_categorical","(","``","y","''",",","[","-1",",","0",",","1","]",")","f1","=","x","*","*","2","+","y","f2","=","-","(","(","x","-","2",")","*","*","2","+","y",")","return","f1",",","f2","#","We","minimize","the","first","objective","and","maximize","the","second","objective",".","sampler","=","optuna.samplers.TPESampler","(",")","study","=","optuna.create_study","(","directions=","[","``","minimize","''",",","``","maximize","''","]",",","sampler=sampler",")","study.optimize","(","objective",",","n_trials=100",")","For","further","information","about","MOTPE","algorithm",",","please","refer","to","the","following","papers",":","-","`","Multiobjective","tree-structured","parzen","estimator","for","computationally","expensive","optimization","problems","<","https",":","\/\/dl.acm.org\/doi\/abs\/10.1145\/3377930.3389817",">","`","_","-","`","Multiobjective","Tree-Structured","Parzen","Estimator","<","https",":","\/\/doi.org\/10.1613\/jair.1.13188",">","`","_","Args",":","consider_prior",":","Enhance","the","stability","of","Parzen","estimator","by","imposing","a","Gaussian","prior","when",":","obj",":","`","True","`",".","The","prior","is","only","effective","if","the","sampling","distribution","is","either",":","class",":","`","~optuna.distributions.FloatDistribution","`",",","or",":","class",":","`","~optuna.distributions.IntDistribution","`",".","prior_weight",":","The","weight","of","the","prior",".","This","argument","is","used","in",":","class",":","`","~optuna.distributions.FloatDistribution","`",",",":","class",":","`","~optuna.distributions.IntDistribution","`",",","and",":","class",":","`","~optuna.distributions.CategoricalDistribution","`",".","consider_magic_clip",":","Enable","a","heuristic","to","limit","the","smallest","variances","of","Gaussians","used","in","the","Parzen","estimator",".","consider_endpoints",":","Take","endpoints","of","domains","into","account","when","calculating","variances","of","Gaussians","in","Parzen","estimator",".","See","the","original","paper","for","details","on","the","heuristics","to","calculate","the","variances",".","n_startup_trials",":","The","random","sampling","is","used","instead","of","the","MOTPE","algorithm","until","the","given","number","of","trials","finish","in","the","same","study",".","11","*","number","of","variables","-","1","is","recommended","in","the","original","paper",".","n_ehvi_candidates",":","Number","of","candidate","samples","used","to","calculate","the","expected","hypervolume","improvement",".","gamma",":","A","function","that","takes","the","number","of","finished","trials","and","returns","the","number","of","trials","to","form","a","density","function","for","samples","with","low","grains",".","See","the","original","paper","for","more","details",".","weights_above",":","A","function","that","takes","the","number","of","finished","trials","and","returns","a","weight","for","them",".","As","default",",","weights","are","automatically","calculated","by","the","MOTPE","'s","default","strategy",".","seed",":","Seed","for","random","number","generator",".","..","note",":",":","Initialization","with","Latin","hypercube","sampling","may","improve","optimization","performance",".","However",",","the","current","implementation","only","supports","initialization","with","random","sampling",".","Example",":","..","testcode",":",":","import","optuna","seed","=","128","num_variables","=","9","n_startup_trials","=","11","*","num_variables","-","1","def","objective","(","trial",")",":","x","=","[","]","for","i","in","range","(","1",",","num_variables","+","1",")",":","x.append","(","trial.suggest_float","(","f","''","x","{","i","}","''",",","0.0",",","2.0","*","i",")",")","return","x","sampler","=","optuna.multi_objective.samplers.MOTPEMultiObjectiveSampler","(","n_startup_trials=n_startup_trials",",","n_ehvi_candidates=24",",","seed=seed",")","study","=","optuna.multi_objective.create_study","(","[","``","minimize","''","]","*","num_variables",",","sampler=sampler",")","study.optimize","(","objective",",","n_trials=250",")"]
code: def __init__(
      self,
      consider_prior: bool = True,
      prior_weight: float = 1.0,
      consider_magic_clip: bool = True,
      consider_endpoints: bool = True,
      n_startup_trials: int = 10,
      n_ehvi_candidates: int = 24,
      gamma: Callable[[int], int] = default_gamma,
      weights_above: Callable[
          [int], np.ndarray
      ] = _default_weights_above,
      seed: Optional[int] = None,
  ) -> None:
      with warnings.catch_warnings():
          warnings.simplefilter("ignore", ExperimentalWarning)
          self._motpe_sampler = MOTPESampler(
              consider_prior=consider_prior,
              prior_weight=prior_weight,
              consider_magic_clip=consider_magic_clip,
              consider_endpoints=consider_endpoints,
              n_startup_trials=n_startup_trials,
              n_ehvi_candidates=n_ehvi_candidates,
              gamma=gamma,
              weights_above=weights_above,
              seed=seed,
          )
  
imports: from typing import Any
  from typing import Callable
  from typing import Dict
  from typing import Optional
  import warnings
  import numpy
  import optuna
  from optuna import multi_objective
  from optuna._deprecated import deprecated_class
  from optuna.distributions import BaseDistribution
  from optuna.exceptions import ExperimentalWarning
  from optuna.multi_objective.samplers import _MultiObjectiveSamplerAdapter
  from optuna.multi_objective.samplers import BaseMultiObjectiveSampler
  from optuna.pruners import NopPruner
  from optuna.samplers import MOTPESampler
  from optuna.samplers._tpe.multi_objective_sampler import _default_weights_above
  from optuna.samplers._tpe.multi_objective_sampler import default_gamma
  from optuna.study import create_study
  from optuna.trial import create_trial
  from optuna.trial import FrozenTrial
label_desc: Use image node_id 1 to create a new MOTPEMultiObjectiveSampler object from inherited base classes: BaseMultiObjectiveSampler with example: obj = MOTPEMultiObjectiveSampler(consider_prior, prior_weight, consider_magic_clip, consider_endpoints, n_startup_trials, n_ehvi_candidates, gamma, weights_above, seed)