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 exportSingleParameterLossChart(
      self,
      fileName,
      results,
      parameter,
      valueKey="loss",
      title="Loss Chart",
      cutoff=1.0,
      numBuckets=None,
      reduction="mean",
  ):
      (
          values,
          linearTrendLine,
          exponentialTrendLine,
      ) = self.computeParameterResultValues(
          results,
          parameter,
          valueKey,
          cutoff,
          numBuckets,
          bucket_reduction=reduction,
      )
  
      if self.singleParameterLossFigure is None:
          fig, ax = plt.subplots()
          self.singleParameterLossFigure = fig
          self.singleParameterLossAxes = ax
      else:
          fig = self.singleParameterLossFigure
          ax = self.singleParameterLossAxes
          ax.clear()
  
      fig.suptitle(title + " for " + parameter.root[5:])
  
      if parameter.config.get("scaling", "linear") == "logarithmic":
          ax.set_xscale("log")
      else:
          ax.set_xscale("linear")
  
      xCoords = [value[parameter.root[5:]] for value in values]
      yCoords = [value[valueKey] for value in values]
  
      ax.set_xlabel(parameter.root[5:])
      ax.set_ylabel(valueKey)
  
      ax.scatter(xCoords, yCoords)
  
      minVal = parameter.config.get("min")
      maxVal = parameter.config.get("max")
      if (
          minVal > 0.001
          and minVal < 10000
          and maxVal > 0.001
          and maxVal < 10000
      ):
          ax.xaxis.set_minor_formatter(mticker.ScalarFormatter())
          ax.xaxis.set_major_formatter(mticker.ScalarFormatter())
      else:
          ax.xaxis.set_minor_formatter(
              mticker.LogFormatterSciNotation()
          )
          ax.xaxis.set_major_formatter(
              mticker.LogFormatterSciNotation()
          )
  
      # Preserve the limits of the scatter graph when we apply the trend line
      xlim = ax.get_xlim()
      ylim = ax.get_ylim()
  
      if linearTrendLine and exponentialTrendLine:
          trendLineXCoords = [
              linearTrendLine[index][0]
              for index in range(len(linearTrendLine))
          ]
          ax.plot(
              trendLineXCoords,
              [
                  (
                      linearTrendLine[index][1],
                      exponentialTrendLine[index][1],
                  )
                  for index in range(len(exponentialTrendLine))
              ],
              color="red",
              linestyle="dashed",
          )
      elif linearTrendLine:
          trendLineXCoords = [
              linearTrendLine[index][0]
              for index in range(len(linearTrendLine))
          ]
          ax.plot(
              trendLineXCoords,
              [
                  linearTrendLine[index][1]
                  for index in range(len(linearTrendLine))
              ],
              color="red",
              linestyle="dashed",
          )
      elif exponentialTrendLine:
          trendLineXCoords = [
              exponentialTrendLine[index][0]
              for index in range(len(linearTrendLine))
          ]
          ax.plot(
              trendLineXCoords,
              [
                  exponentialTrendLine[index][1]
                  for index in range(len(exponentialTrendLine))
              ],
              color="red",
              linestyle="dashed",
          )
  
      ax.set_xlim(xlim)
      ax.set_ylim(ylim)
  
      fig.set_tight_layout(True)
      fig.savefig(fileName, dpi=200)
      plt.close(fig)
  
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 12 for calling the ResultsAnalyzer obj's underlying member method code with example usage: obj.exportSingleParameterLossChart(fileName, results, parameter, valueKey, title, cutoff, numBuckets, reduction) without return types