code: def __init__(
      self,
      results_path,
      ml_task,
      eval_metric,
      time_budget=3600,
      init_params={},
      verbose=True,
      n_jobs=-1,
      random_state=42,
  ):
      if eval_metric.name not in [
          "auc",
          "logloss",
          "rmse",
          "mse",
          "mae",
          "mape",
          "r2",
          "spearman",
          "pearson",
          "f1",
          "average_precision",
          "accuracy",
          "user_defined_metric",
      ]:
          raise AutoMLException(
              f"Metric {eval_metric.name} is not supported"
          )
  
      self.study_dir = os.path.join(results_path, "optuna")
      if not os.path.exists(self.study_dir):
          try:
              os.mkdir(self.study_dir)
          except Exception as e:
              print(
                  "Problem while creating directory for optuna studies.",
                  str(e),
              )
      self.tuning_fname = os.path.join(self.study_dir, "optuna.json")
      self.tuning = init_params
      self.eval_metric = eval_metric
  
      self.direction = (
          "maximize"
          if Metric.optimize_negative(eval_metric.name)
          else "minimize"
      )
      self.n_warmup_steps = (
          500  # set large enough to give small learning rates a chance
      )
      self.time_budget = time_budget
      self.verbose = verbose
      self.ml_task = ml_task
      self.n_jobs = n_jobs
      self.random_state = random_state
      self.cat_features_indices = []
      self.load()
      if not self.verbose:
          optuna.logging.set_verbosity(optuna.logging.CRITICAL)
  
imports: import json
  import os
  import warnings
  import joblib
  import matplotlib
  import optuna
  from matplotlib import pyplot
  from supervised.exceptions import AutoMLException
  from supervised.preprocessing.preprocessing_utils import PreprocessingUtils
  from supervised.tuner.optuna.catboost import CatBoostObjective
  from supervised.tuner.optuna.extra_trees import ExtraTreesObjective
  from supervised.tuner.optuna.knn import KNNObjective
  from supervised.tuner.optuna.lightgbm import LightgbmObjective
  from supervised.tuner.optuna.nn import NeuralNetworkObjective
  from supervised.tuner.optuna.random_forest import RandomForestObjective
  from supervised.tuner.optuna.xgboost import XgboostObjective
  from supervised.utils.metric import Metric
  from supervised.utils.jsonencoder import MLJSONEncoder
label_desc: Use image node_id 1 to create a new OptunaTuner object  with example: obj = OptunaTuner(results_path, ml_task, eval_metric, time_budget, init_params, verbose, n_jobs, random_state)