code: def get_best_params(combinations, scores, param_names, target_metric):
      max_id = np.argmax(scores)
      best_params = dict(zip(param_names, combinations[max_id]))
      best_params[target_metric] = scores[max_id]
  
      return best_params
  
file_path: DeepPavlov/deeppavlov/paramsearch.py
imports: import argparse
  import sys
  from copy import deepcopy
  from itertools import product
  from logging import getLogger
  from pathlib import Path
  import numpy
  from sklearn.model_selection import train_test_split
  from deeppavlov.core.commands.train import train_evaluate_model_from_config, get_iterator_from_config, read_data_by_config
  from deeppavlov.core.commands.utils import parse_config
  from deeppavlov.core.common.cross_validation import calc_cv_score
  from deeppavlov.core.common.file import save_json, find_config, read_json
  from deeppavlov.core.common.params_search import ParamsSearch
label_desc: Use image node_id 1 for calling a global function with example usage: get_best_params(combinations, scores, param_names, target_metric) and returns: best_params