code: def get_best_config(
      df_exp: pd.DataFrame,
      dataset_type_col: str,
      key_info: dict,
      topk: int,
      show_analysis: bool,
      exp_type: str,
  ):
      """Get the best hyperparameter configuration for a given subset of experiments.
  
      Args:
          df_exp: Dataframe of all experiments
          dataset_type_col: Name of the column containing the dataset types
          key_info: Dictionary containing the name of the column and the attribute to use for analysis
          topk: Number of top-k results to display
          show_analysis: Whether to display the analysis table
          exp_type: Type of experiments in the dataframe
      """
      # Columns to consider for hyperparameter combinations
      hyperparamter_cols = (
          ADAPTER_HYPERPARAMTER_COLUMNS
          if exp_type == "adapters"
          else FINETUNING_HYPERPARAMETER_COLUMNS
      )
  
      # Columns to display in the analysis table
      analysis_columns = list(
          set(
              [
                  key_info["name"],
                  TEST_WER_COLUMN,
                  ORIGINAL_TEST_WER_COLUMN,
              ]
          )
      )
  
      df_analyze = df_exp.drop(
          columns=[
              x
              for x in df_exp.columns
              if x
              not in set(
                  hyperparamter_cols
                  + [EXP_CATEGORY_KEY[exp_type]]
                  + analysis_columns
              )
          ]
      )
  
      for category in df_exp[EXP_CATEGORY_KEY[exp_type]].unique():
          # Group all hyperparameter configurations and do mean across all speakers
          df_category_mean = (
              df_analyze[
                  df_analyze[EXP_CATEGORY_KEY[exp_type]] == category
              ]
              .groupby(hyperparamter_cols, as_index=False)[
                  analysis_columns
              ]
              .mean()
          )
  
          # Sort the values by the key in order to get the top-k results
          df_category_mean.sort_values(
              by=key_info["name"],
              ascending=True
              if key_info["attribute"].__qualname__ == "min"
              else False,
              inplace=True,
          )
  
          print("=" * len(category))
          print(category.upper())
          print("=" * len(category) + "\n")
  
          if show_analysis:
              display_analysis_table(df_category_mean, key_info)
              print("\n")
  
          for idx in range(min(topk, len(df_category_mean))):
              print("-----")
              print(f"Top-{idx + 1}")
              print("-----")
  
              df_category_best = df_category_mean.iloc[idx]
  
              print(f"\nHyperparamters")
              print("---------------\n")
              for hyperparamter in hyperparamter_cols + [
                  key_info["name"]
              ]:
                  print(
                      f"{hyperparamter:<20}: {df_category_best[hyperparamter]}"
                  )
              print()
  
              print("\nResults")
              print("-------\n")
              display_results(
                  df_exp,
                  category,
                  df_category_best,
                  dataset_type_col,
                  exp_type,
              )
  
file_path: NeMo/examples/asr/asr_adapters/scoring_and_analysis.py
imports: import argparse
  from typing import Tuple
  import numpy
  import pandas
label_desc: Use image node_id 6 for calling a global function with example usage: get_best_config(df_exp, dataset_type_col, key_info, topk, show_analysis, exp_type) without return types