class_docstr: This class is responsible for analyzing the results and outputting various types of analysis to the results folder.
class_docstr_tok: ["This","class","is","responsible","for","analyzing","the","results","and","outputting","various","types","of","analysis","to","the","results","folder","."]
code: def exportLossMatrixToCSV(
      self,
      fileName,
      results,
      parameter1,
      parameter2,
      valueKey="loss",
      cutoff=1.0,
      reduction="min",
  ):
      (
          scores,
          parameter1Buckets,
          parameter2Buckets,
      ) = self.computeLossMatrix(
          results,
          parameter1,
          parameter2,
          valueKey,
          cutoff=cutoff,
          reduction=reduction,
      )
  
      with open(fileName, "wt") as file:
          writer = csv.writer(file)
          param1Padding = int((len(parameter1Buckets) - 1) / 2)
          param2Padding = int((len(parameter2Buckets) - 1) / 2) - 1
  
          writer.writerow(
              ["", ""]
              + ([""] * param1Padding)
              + [parameter1.root[5:]]
              + ([""] * (param1Padding))
              + ["", "", ""]
          )
          writer.writerow(
              ["", "", ""] + parameter1Buckets + ["", "", ""]
          )
          writer.writerow(
              ["", "", ""]
              + [""] * (len(parameter1Buckets))
              + ["", "", ""]
          )
          writer.writerow(
              ["", str(parameter2Buckets[0]), ""]
              + [""] * (len(parameter1Buckets))
              + ["", str(parameter2Buckets[0]), ""]
          )
          for rowIndex, row in enumerate(scores):
              if rowIndex == param2Padding:
                  writer.writerow(
                      [
                          parameter2.root[5:],
                          str(parameter2Buckets[rowIndex + 1]),
                          "",
                          "",
                      ]
                      + list(row)
                      + [
                          "",
                          str(parameter2Buckets[rowIndex + 1]),
                          parameter2.root[5:],
                      ]
                  )
              else:
                  writer.writerow(
                      ["", str(parameter2Buckets[rowIndex + 1]), "", ""]
                      + list(row)
                      + ["", str(parameter2Buckets[rowIndex + 1]), ""]
                  )
          writer.writerow([""] * (len(parameter1Buckets) + 3))
          writer.writerow(["", "", ""] + parameter1Buckets)
          writer.writerow(
              ["", ""]
              + ([""] * param1Padding)
              + [parameter1.root[5:]]
              + ([""] * (param1Padding))
          )
  
imports: import jsonschema
  import os
  import os.path
  import math
  import csv
  from hypermax.hyperparameter import Hyperparameter
  import sklearn.covariance
  import numpy
  from hypermax.utils import roundPrecision
  import matplotlib
  import matplotlib.cm
  import matplotlib.style
  import matplotlib.pyplot
  from pprint import pprint
  import concurrent.futures
  import colors
  import traceback
  import functools
  import warnings
  import scipy.optimize
  import random
  import json
  import atexit
  import matplotlib.ticker
  import traceback
  import copy
label_desc: Use image node_id 10 for calling the ResultsAnalyzer obj's underlying member method code with example usage: obj.exportLossMatrixToCSV(fileName, results, parameter1, parameter2, valueKey, cutoff, reduction) without return types