code: def main(eid, log, scale, save):
      """Visualize result for experiment
      \b\n
      Copyright (C) 2018  LG Electronics Inc.
      \b\n
      GPL-3.0 License. This program comes with ABSOLUTELY NO WARRANTY;
      \b\n
      Arguments:
          eid {int} -- Experiment ID
      """
      coloredlogs.install(
          level=_log_level[log],
          fmt="%(asctime)-15s - %(name)s - %(levelname)s - %(message)s",
      )
      sql = get_default_connector()
      sql.cursor.execute(
          "SELECT * FROM experiment where eid = ?", (eid,)
      )
      experiment_config = json.loads(sql.cursor.fetchone()[4])
  
      history = sql.get_all_history(eid)
      history = pd.DataFrame(history)
      history.columns = [
          "jid",
          "score",
          "eid",
          "rid",
          "start_time",
          "end_time",
          "job_config",
      ]
  
      fig = plt.figure(figsize=(16, 8))
      fig.suptitle(
          "Search Algorithm %s" % experiment_config["proposer"]
      )
      plt.subplot(121)
      plt.plot(history.score)
      plt.legend()
      plt.xlabel("Iteration")
      plt.ylabel("Accuracy")
      plt.yscale(scale)
  
      plt.subplot(122)
      if experiment_config["target"] == "min":
          plt.plot(history.score.cummin())
          job = history.loc[history.score.idxmin()]
      else:
          plt.plot(history.score.cummax())
          job = history.loc[history.score.idxmax()]
      plt.legend()
      plt.xlabel("Iteration")
      plt.ylabel("Best Accuracy so far")
      plt.yscale(scale)
  
      print(
          "Best score is %f with config %s"
          % (job.score, job.job_config)
      )
      if save:
          plt.savefig(save)
      else:
          plt.show()
  
file_path: auptimizer/src/aup/visualize.py
imports: import json
  import logging
  import os
  import click
  import coloredlogs
  import pandas
  import matplotlib.pylab
  from .utils import get_default_connector
label_desc: Use image node_id 1 for calling a global function with example usage: main(eid, log, scale, save) without return types