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 computeOptimizationResults(
      self,
      number_histories=10,
      trial_lengths=None,
      atpeSearchLength=1000,
      verbose=False,
      processExecutor=None,
  ):
      if trial_lengths is None:
          trial_lengths = [
              10,
              10,
              10,
              10,
              10,
              10,
              10,
              10,
              10,
              25,
              25,
              25,
              25,
              25,
              25,
          ]
  
      # Construct 10 different result histories. Each history will represent a different convergence speed, with different assumptions on how good our ATPE
      # parameters were at that point in the history
      histories = [[] for history in range(number_histories)]
  
      # Seed each history with 10 random results, representing the initialization period
      for history in histories:
          best, newResults = self.runSearch(
              currentResults=[], trials=10, atpeParams=None
          )
          for result in newResults:
              history.append(result)
  
      optimizationResults = []
  
      # Loop for each of our trial lengths
      for length in trial_lengths:
          # Now for each history, find the optimal ATPE parameters.
          allATPEParamResultFutures = []
          for historyIndex, history in enumerate(histories):
              self.computeLoss = None  # Delete the computeLoss function - it can't be pickled. But it can just be recreated from the computeScript
              allATPEParamResultFutures.append(
                  processExecutor.submit(
                      self.computeBestATPEParamsAtHistory,
                      history,
                      historyIndex,
                      atpeSearchLength,
                      length,
                  )
              )
  
          allATPEParamResults = []
          for future in concurrent.futures.as_completed(
              allATPEParamResultFutures
          ):
              stats, trialATPEParamResults = future.result()
              allATPEParamResults = (
                  allATPEParamResults + trialATPEParamResults
              )
              optimizationResults.append(stats)
              if verbose:
                  pprint(stats)
                  sys.stdout.flush()
                  sys.stderr.flush()
  
          # Now we extend each history by using ATPE parameters at various percentiles
          sortedATPEParamResults = sorted(
              allATPEParamResults, key=lambda result: result["loss"]
          )
  
          for historyIndex, history in enumerate(histories):
              percentile = (
                  float(historyIndex + 1) / float(len(histories))
              ) * 0.5
              index = int(percentile * float(len(histories)))
              atpeParamsForExtension = sortedATPEParamResults[index][
                  "atpeParams"
              ]
              # print(atpeParamsForExtension)
              best, newResults = self.runSearch(
                  currentResults=copy.deepcopy(history),
                  trials=length,
                  atpeParams=atpeParamsForExtension,
              )
              for result in newResults:
                  history.append(result)
      return optimizationResults
  
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 13 for calling the AlgorithmSimulation obj's underlying member method code with example usage: obj.computeOptimizationResults(number_histories, trial_lengths, atpeSearchLength, verbose, processExecutor) and returns: optimizationResults