class_docstr: `SMAC <https://www.cs.ubc.ca/~hutter/papers/10-TR-SMAC.pdf>`__ is based on Sequential Model-Based Optimization (SMBO).
  It adapts the most prominent previously used model class (Gaussian stochastic process models)
  and introduces the model class of random forests to SMBO in order to handle categorical parameters.
  
  The SMAC supported by nni is a wrapper on `the SMAC3 github repo <https://github.com/automl/SMAC3>`__,
  following NNI tuner interface :class:`nni.tuner.Tuner`. For algorithm details of SMAC, please refer to the paper
  :footcite:t:`hutter2011sequential`.
  
  Note that SMAC on nni only supports a subset of the types in
  :doc:`search space </hpo/search_space>`:
  ``choice``, ``randint``, ``uniform``, ``loguniform``, and ``quniform``.
  
  Note that SMAC needs additional installation using the following command:
  
  .. code-block:: bash
  
      pip install nni[SMAC]
  
  ``swig`` is required for SMAC. for Ubuntu ``swig`` can be installed with ``apt``.
  
  Examples
  --------
  
  .. code-block::
  
      config.tuner.name = 'SMAC'
      config.tuner.class_args = {
          'optimize_mode': 'maximize'
      }
  
  Parameters
  ----------
  optimize_mode : str
      Optimize mode, 'maximize' or 'minimize', by default 'maximize'
  config_dedup : bool
      If True, the tuner will not generate a configuration that has been already generated.
      If False, a configuration may be generated twice, but it is rare for relatively large search space.
docstr: Import additional data for tuning.
  
  Parameters
  ----------
  data : list of dict
      Each of which has at least two keys, ``parameter`` and ``value``.
docstr_tok: ["Import","additional","data","for","tuning",".","Parameters","--","--","--","--","--","data",":","list","of","dict","Each","of","which","has","at","least","two","keys",",","``","parameter","``","and","``","value","``","."]
code: def import_data(self, data):
      """
      Import additional data for tuning.
  
      Parameters
      ----------
      data : list of dict
          Each of which has at least two keys, ``parameter`` and ``value``.
      """
      _completed_num = 0
      for trial_info in data:
          self.logger.info(
              "Importing data, current processing progress %s / %s",
              _completed_num,
              len(data),
          )
          # simply validate data format
          assert "parameter" in trial_info
          _params = trial_info["parameter"]
          assert "value" in trial_info
          _value = trial_info["value"]
          if not _value:
              self.logger.info(
                  "Useless trial data, value is %s, skip this trial data.",
                  _value,
              )
              continue
          _value = extract_scalar_reward(_value)
          # convert the keys in loguniform and categorical types
          valid_entry = True
          for key, value in _params.items():
              if key in self.loguniform_key:
                  _params[key] = np.log(value)
              elif key in self.categorical_dict:
                  if value in self.categorical_dict[key]:
                      _params[key] = self.categorical_dict[key].index(
                          value
                      )
                  else:
                      self.logger.info(
                          "The value %s of key %s is not in search space.",
                          str(value),
                          key,
                      )
                      valid_entry = False
                      break
          if not valid_entry:
              continue
          # start import this data entry
          _completed_num += 1
          config = Configuration(self.cs, values=_params)
          if self.optimize_mode is OptimizeMode.Maximize:
              _value = -_value
          if self.first_one:
              self.smbo_solver.nni_smac_receive_first_run(
                  config, _value
              )
              self.first_one = False
          else:
              self.smbo_solver.nni_smac_receive_runs(config, _value)
      self.logger.info(
          "Successfully import data to smac tuner, total data: %d, imported data: %d.",
          len(data),
          _completed_num,
      )
  
imports: import logging
  import sys
  import numpy
  from schema import Schema, Optional
  from smac.facade.epils_facade import EPILS
  from smac.facade.roar_facade import ROAR
  from smac.facade.smac_facade import SMAC
  from smac.scenario.scenario import Scenario
  from smac.utils.io.cmd_reader import CMDReader
  from ConfigSpaceNNI import Configuration
  import nni
  from nni import ClassArgsValidator
  from nni.common.hpo_utils import validate_search_space
  from nni.tuner import Tuner
  from nni.utils import OptimizeMode, extract_scalar_reward
  from .convert_ss_to_scenario import generate_scenario
label_desc: Use image node_id 8 for calling the SMACTuner obj's underlying member method code with example usage: obj.import_data(data) without return types