code: def hyperopt_category_plot(
      hyperopt_results_df,
      hp_name,
      metric,
      title,
      filename,
      log_scale=True,
  ):
      sns.set_style("whitegrid")
      plt.figure()
  
      # Ensure that all parameter values have at least 2 trials, otherwise the Raincloud Plot will create awkward
      # looking "flat clouds" in the cloud part of the plot (the "rain" part is ok with 1 trial). In this case,
      # just use stripplots since they are categorical scatter plots.
      parameter_to_trial_count = hyperopt_results_df[
          hp_name
      ].value_counts()
      parameter_to_trial_count = parameter_to_trial_count[
          parameter_to_trial_count < 2
      ]
  
      if len(parameter_to_trial_count) != 0:
          seaborn_figure = sns.stripplot(
              x=hp_name, y=metric, data=hyperopt_results_df, size=5
          )
      else:
          seaborn_figure = pt.RainCloud(
              x=hp_name,
              y=metric,
              data=hyperopt_results_df,
              palette="Set2",
              bw=0.2,
              width_viol=0.7,
              point_size=6,
              cut=1,
          )
  
      seaborn_figure.set_title(title)
      seaborn_figure.set(ylabel=metric)
      sns.despine()
      if log_scale:
          seaborn_figure.set(yscale="log")
      plt.tight_layout()
      if filename:
          plt.savefig(filename)
      else:
          plt.show()
  
imports: import copy
  import logging
  from collections import Counter
  from sys import platform
  from typing import Dict, List
  import numpy
  import pandas
  import ptitprince
  from packaging import version
  from ludwig.constants import SPACE, TRAINING, VALIDATION
label_desc: Use image node_id 28 for calling a global function with example usage: hyperopt_category_plot(hyperopt_results_df, hp_name, metric, title, filename, log_scale) without return types