class_docstr: This class represents a simulation of hypothetical machine learning algorithm hyper-parameter spaces.
  
  It is mostly used for conducting abstract research into hyper-parameter optimization.
class_docstr_tok: ["This","class","represents","a","simulation","of","hypothetical","machine","learning","algorithm","hyper-parameter","spaces",".","It","is","mostly","used","for","conducting","abstract","research","into","hyper-parameter","optimization","."]
code: def computeBestATPEParamsAtHistory(
      self, history, historyIndex, atpeSearchLength, length
  ):
      start = datetime.datetime.now()
  
      # Compute stats
      stats = self.computeAllResultStatistics(history)
  
      trialATPEParamResults = []
  
      # Create a function which evaluates ATPE parameters, given a history
      def evaluateATPEParameters(history, length, atpeParameters):
          # pprint(atpeParameters)
          # Copy the history, so it doesn't get modified
          best, _ = self.runSearch(
              currentResults=copy.deepcopy(history),
              trials=length,
              atpeParams=atpeParameters,
          )
          data = {"loss": best["loss"], "atpeParams": atpeParameters}
          trialATPEParamResults.append(data)
          return best["loss"]
  
      dict(
          hyperopt.fmin(
              fn=functools.partial(
                  evaluateATPEParameters, history, length
              ),
              space=self.getATPEHyperoptSpace(),
              algo=functools.partial(
                  hyperopt.tpe.suggest,
                  n_startup_jobs=10,
                  gamma=1.0,
                  n_EI_candidates=4,
              ),
              max_evals=atpeSearchLength,
              rstate=numpy.random.RandomState(
                  seed=int(random.randint(1, 2**32 - 1))
              ),
          )
      )
  
      best = min(
          trialATPEParamResults, key=lambda result: result["loss"]
      )
      flatAtpeParams = self.getFlatATPEParameters(best["atpeParams"])
      for param in flatAtpeParams.keys():
          stats[param] = flatAtpeParams[param]
  
      stats["trial"] = len(history)
      stats["log10_trial"] = math.log10(len(history))
      stats["history"] = historyIndex
      stats["loss"] = best["loss"]
      stats["time"] = (datetime.datetime.now() - start).total_seconds()
      return stats, trialATPEParamResults
  
imports: import hyperopt
  import math
  import json
  import random
  import numpy
  import functools
  import concurrent.futures
  import os
  import sys
  import time
  import datetime
  import subprocess
  import scipy.stats
  import csv
  import pickle
  import matplotlib.pyplot
  from scipy.stats import norm
  import scipy.interpolate
  import copy
  import sklearn.preprocessing
  import sklearn.cluster
  from hypermax.utils import roundPrecision
  from hypermax.hyperparameter import Hyperparameter
  from pprint import pprint
  import psutil
  import lightgbm
label_desc: Use image node_id 12 for calling the AlgorithmSimulation obj's underlying member method code with example usage: obj.computeBestATPEParamsAtHistory(history, historyIndex, atpeSearchLength, length) and returns: stats,  trialATPEParamResults, best