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 createHyperParameterInteraction(self, param1, param2, type=None):
      if type is None:
          type = random.randint(0, 3)
  
      self.interactionCounts[type] += 1
  
      def square(weight):
          return weight * weight
  
      if type == 0:
          coords = [
              roundPrecision(random.uniform(0, 1)) for n in range(4)
          ]
  
          coords[
              random.randint(0, 1)
          ] = 0  # At least one of the four corners always touches 0, and one always touches 1
          coords[
              random.randint(2, 3)
          ] = 1.0  # At least one of the four corners always touches 0, and one always touches 1
  
          xStart = coords[0]
          xEnd = coords[1]
          yStart = coords[2]
          yEnd = coords[3]
  
          xSlope = roundPrecision(xEnd - xStart)
          ySlope = roundPrecision(yEnd - yStart)
  
          maxVal = max(xStart, xEnd) * max(yStart, yEnd)
  
          return {
              "type": "linear",
              "func": "lambda x,y: ({0} + {1} * x) * ({2} + {3} * y) / {4}".format(
                  xStart, xSlope, yStart, ySlope, maxVal
              ),
              "param1": param1,
              "param2": param2,
              "weight": roundPrecision(square(random.uniform(0, 3))),
          }
      elif type == 1:
          peakX = roundPrecision(random.uniform(0, 1))
          peakY = roundPrecision(random.uniform(0, 1))
          spread = roundPrecision(random.uniform(0.5, 4.0))
          isHole = random.choice([True, False])
  
          if isHole:
              return {
                  "type": "peak",
                  "func": "lambda x, y: min(1.0, max(0, norm.pdf((x - {1}) * {0}) * norm.pdf((y - {3}) * {2}) * 7))".format(
                      spread, peakX, spread, peakY
                  ),
                  "param1": param1,
                  "param2": param2,
                  "weight": roundPrecision(
                      square(random.uniform(0, 3))
                  ),
              }
          else:
              return {
                  "type": "hole",
                  "func": "lambda x, y: min(1.0, max(0, 1.0 - norm.pdf((x - {1}) * {0}) * norm.pdf((y - {3}) * {2}) * 7))".format(
                      spread, peakX, spread, peakY
                  ),
                  "param1": param1,
                  "param2": param2,
                  "weight": roundPrecision(
                      square(random.uniform(0, 3))
                  ),
              }
      elif type == 2:
          xScale = roundPrecision(random.uniform(0.1, 3 * math.pi * 2))
          yScale = roundPrecision(random.uniform(0.1, 3 * math.pi * 2))
  
          xPhase = roundPrecision(random.uniform(0.1, 3 * math.pi * 2))
          yPhase = roundPrecision(random.uniform(0.1, 3 * math.pi * 2))
  
          return {
              "type": "waves",
              "func": "lambda x, y: (math.sin(x*{0} + {1}) + 1.0) * (math.sin(y*{2} + {3}) + 1.0) / 4.0".format(
                  xScale, xPhase, yScale, yPhase
              ),
              "param1": param1,
              "param2": param2,
              "weight": roundPrecision(square(random.uniform(0, 3))),
          }
      elif type == 3:
          sizeX = random.randint(3, 6)
          sizeY = random.randint(3, 6)
          grid = []
          for x in range(sizeY):
              row = []
              for y in range(sizeX):
                  row.append(
                      roundPrecision(square(random.uniform(0, 1)))
                  )
              grid.append(row)
  
          return {
              "type": "random",
              "func": "scipy.interpolate.interp2d({0}, {1}, {2}, kind='linear')".format(
                  json.dumps(list(numpy.linspace(0, 1.0, sizeX))),
                  json.dumps(list(numpy.linspace(0, 1.0, sizeY))),
                  json.dumps(grid),
              ),
              "param1": param1,
              "param2": param2,
              "weight": roundPrecision(square(random.uniform(0, 3))),
          }
  
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
  from scipy.stats import norm
  import scipy.interpolate
  from hypermax.utils import roundPrecision
  from hypermax.hyperparameter import Hyperparameter
  from pprint import pprint
  import lightgbm
label_desc: Use image node_id 3 for calling the AlgorithmSimulation obj's underlying member method code with example usage: obj.createHyperParameterInteraction(param1, param2, type) and returns: unknown, dict, dict, dict, dict, dict