class_docstr: `Metis tuner <https://www.microsoft.com/en-us/research/publication/metis-robustly-tuning-tail-latencies-cloud-systems/>`__ offers
  several benefits over other tuning algorithms.
  While most tools only predict the optimal configuration, Metis gives you two outputs,
  a prediction for the optimal configuration and a suggestion for the next trial.
  No more guess work!
  
  While most tools assume training datasets do not have noisy data,
  Metis actually tells you if you need to resample a particular hyper-parameter.
  
  While most tools have problems of being exploitation-heavy,
  Metis' search strategy balances exploration, exploitation, and (optional) resampling.
  
  Metis belongs to the class of sequential model-based optimization (SMBO) algorithms
  and it is based on the Bayesian Optimization framework. To model the parameter-vs-performance space,
  Metis uses both a Gaussian Process and GMM. Since each trial can impose a high time cost,
  Metis heavily trades inference computations with naive trials.
  At each iteration, Metis does two tasks (refer to :footcite:t:`li2018metis` for details):
  
  
  1. It finds the global optimal point in the Gaussian Process space.
     This point represents the optimal configuration.
  
  2. It identifies the next hyper-parameter candidate.
     This is achieved by inferring the potential information gain of
     exploration, exploitation, and resampling.
  
  Note that the only acceptable types in the :doc:`search space </hpo/search_space>` are
  ``quniform``, ``uniform``, ``randint``, and numerical ``choice``.
  
  
  Examples
  --------
  
  .. code-block::
  
      config.tuner.name = 'Metis'
      config.tuner.class_args = {
          'optimize_mode': 'maximize'
      }
  
  Parameters
  ----------
  optimize_mode : str
      optimize_mode is a string that including two mode "maximize" and "minimize"
  
  no_resampling : bool
      True or False.
      Should Metis consider re-sampling as part of the search strategy?
      If you are confident that the training dataset is noise-free,
      then you do not need re-sampling.
  
  no_candidates : bool
      True or False.
      Should Metis suggest parameters for the next benchmark?
      If you do not plan to do more benchmarks,
      Metis can skip this step.
  
  selection_num_starting_points : int
      How many times Metis should try to find the global optimal in the search space?
      The higher the number, the longer it takes to output the solution.
  
  cold_start_num : int
      Metis need some trial result to get cold start.
      when the number of trial result is less than
      cold_start_num, Metis will randomly sample hyper-parameter for trial.
  
  exploration_probability: float
      The probability of Metis to select parameter from exploration instead of exploitation.
code: def __init__(
      self,
      optimize_mode="maximize",
      no_resampling=True,
      no_candidates=False,
      selection_num_starting_points=600,
      cold_start_num=10,
      exploration_probability=0.9,
  ):
      self.samples_x = []
      self.samples_y = []
      self.samples_y_aggregation = []
      self.total_data = []
      self.space = None
      self.no_resampling = no_resampling
      self.no_candidates = no_candidates
      self.optimize_mode = OptimizeMode(optimize_mode)
      self.key_order = []
      self.cold_start_num = cold_start_num
      self.selection_num_starting_points = selection_num_starting_points
      self.exploration_probability = exploration_probability
      self.minimize_constraints_fun = None
      self.minimize_starting_points = None
      self.supplement_data_num = 0
      # The constration of parameters
      self.x_bounds = []
      # The type of parameters
      self.x_types = []
  
imports: import copy
  import logging
  import random
  import statistics
  import warnings
  from multiprocessing.dummy import Pool
  import numpy
  from schema import Schema, Optional
  from nni import ClassArgsValidator
  from nni.tuner import Tuner
  from nni.common.hpo_utils import validate_search_space
  from nni.utils import OptimizeMode, extract_scalar_reward
  from .None import lib_constraint_summation
  from .None import lib_data
  from .Regression_GMM import CreateModel
  from .Regression_GMM import Selection
  from .Regression_GP import CreateModel
  from .Regression_GP import OutlierDetection
  from .Regression_GP import Prediction
  from .Regression_GP import Selection
label_desc: Use image node_id 1 to create a new MetisTuner object from inherited base classes: Tuner with example: obj = MetisTuner(optimize_mode, no_resampling, no_candidates, selection_num_starting_points, cold_start_num, exploration_probability)