code: def __init__(self):
      try:
          import lightgbm
          import sklearn
      except ImportError:
          raise ImportError(
              "You must install lightgbm and sklearn in order to use the ATPE algorithm. Please run `pip install lightgbm scikit-learn` and try again. These are not built in dependencies of hyperopt."
          )
  
      scalingModelData = json.loads(
          pkg_resources.resource_string(
              __name__, "atpe_models/scaling_model.json"
          ).decode("utf-8")
      )
      self.featureScalingModels = {}
      for key in self.atpeModelFeatureKeys:
          self.featureScalingModels[
              key
          ] = sklearn.preprocessing.StandardScaler()
          self.featureScalingModels[key].scale_ = numpy.array(
              scalingModelData[key]["scales"]
          )
          self.featureScalingModels[key].mean_ = numpy.array(
              scalingModelData[key]["means"]
          )
          self.featureScalingModels[key].var_ = numpy.array(
              scalingModelData[key]["variances"]
          )
          self.featureScalingModels[key].n_features_in_ = 1
  
      self.parameterModels = {}
      self.parameterModelConfigurations = {}
      for param in self.atpeParameters:
          modelData = pkg_resources.resource_string(
              __name__, "atpe_models/model-" + param + ".txt"
          )
          with ClosedNamedTempFile(modelData) as model_file_name:
              self.parameterModels[param] = lightgbm.Booster(
                  model_file=model_file_name
              )
  
          configString = pkg_resources.resource_string(
              __name__,
              "atpe_models/model-" + param + "-configuration.json",
          )
          data = json.loads(configString.decode("utf-8"))
          self.parameterModelConfigurations[param] = data
  
      self.lastATPEParameters = None
      self.lastLockedParameters = []
      self.atpeParamDetails = None
  
imports: from hyperopt import hp
  from contextlib import contextmanager
  import re
  import functools
  import random
  import numpy
  import numpy.random
  import pkg_resources
  import tempfile
  import scipy.stats
  import os
  import math
  import hyperopt
  import datetime
  import json
  import copy
label_desc: Use image node_id 1 to create a new ATPEOptimizer object  with example: obj = ATPEOptimizer()