code: def get_problem_config(
      target_data,
      framework,
      target_metric,
      metrics_path=resource_filename(__name__, "metrics.yml"),
  ):
      """Gets the problem type, target metric, and metric direction, or infers
      them from the data if not expicitly specified.
  
      # Arguments:
          target_data: Data column to infer problem spec on.
          framework: problem framework
          target_metric: Target metric to optimize (overrides automatic selection)
          metrics_path: location of the metrics file
  
      # Returns:
          problem_type: One of 'regression', 'binary_classification' or
                        'classification'.
          target_metric: Target metric to optimize.
          direction: Direction of the metric to optimize (either 'max' or 'min')
      """
  
      nrows = target_data.size
      num_unique_values = target_data.nunique()
      field_type = target_data.dtype
  
      # Problem Type
      if num_unique_values == 2:
          problem_type = "binary_classification"
      elif field_type == "float64":
          problem_type = "regression"
      else:
          problem_type = "classification"
  
      # Target Metric
      if target_metric is not None:
          pass
      elif problem_type == "regression":
          target_metric = "mse"
      else:
          target_metric = "accuracy"
  
      # Direction
      with open(metrics_path) as f:
          metrics = yaml.safe_load(f)
  
      direction = metrics[target_metric]["objective"]
      direction_text = (
          "minimizing" if direction == "min" else "maximizing"
      )
  
      # Print config to console for user-level debugging.
      print(
          "Solving a {} problem, {} {} using {}.\n".format(
              problem_type, direction_text, target_metric, framework
          )
      )
  
      return problem_type, target_metric, direction
  
imports: import re
  import pandas
  import random
  import yaml
  import os
  import shutil
  from time import time
  from pkg_resources import resource_filename
  from tqdm import tqdm, tqdm_notebook
  from tqdm._utils import _term_move_up
  from subprocess import Popen, PIPE, DEVNULL, CalledProcessError
  from autopep8 import fix_code
  from collections import OrderedDict
label_desc: Use image node_id 6 for calling a global function with example usage: get_problem_config(target_data, framework, target_metric, metrics_path) and returns: problem_type,  target_metric,  direction