docstr: Apply metric(s) to the given data to calculate the value of the `prediction`
  
  Parameters
  ----------
  data_type: {"in_fold", "oof", "holdout"}
      The type of dataset for which `target` and `prediction` arguments are being provided
  target: Array-like
      True labels for the data. Should be same shape as `prediction`
  prediction: Array-like
      Predicted labels for the data. Should be same shape as `target`
  return_list: Boolean, default=False
      If True, return list of tuples instead of dict. See "Returns" section below for details
  dry_run: Boolean, default=False
      If True, the value of :attr:`last_evaluation_results` will not be updated to include
      the returned `_result`. The core library callbacks operate under the assumption that
      `last_evaluation_results` will be updated as usual, so restrict usage to debugging or
      :func:`~hyperparameter_hunter.callbacks.bases.lambda_callback` implementations
  
  Returns
  -------
  _result: OrderedDict, or list
      A dict whose keys are all metric keys supplied for `data_type`, and whose values are the
      results of each metric. If `return_list` is True, returns a list of tuples of:
      (<`data_type` metric str>, <metric result>)
  
  Notes
  -----
  The required types of `target` and `prediction` are entirely dependent on the metric
  callable's expectations
docstr_tok: ["Apply","metric","(","s",")","to","the","given","data","to","calculate","the","value","of","the","`","prediction","`","Parameters","--","--","--","--","--","data_type",":","{","``","in_fold","''",",","``","oof","''",",","``","holdout","''","}","The","type","of","dataset","for","which","`","target","`","and","`","prediction","`","arguments","are","being","provided","target",":","Array-like","True","labels","for","the","data",".","Should","be","same","shape","as","`","prediction","`","prediction",":","Array-like","Predicted","labels","for","the","data",".","Should","be","same","shape","as","`","target","`","return_list",":","Boolean",",","default=False","If","True",",","return","list","of","tuples","instead","of","dict",".","See","``","Returns","''","section","below","for","details","dry_run",":","Boolean",",","default=False","If","True",",","the","value","of",":","attr",":","`","last_evaluation_results","`","will","not","be","updated","to","include","the","returned","`","_result","`",".","The","core","library","callbacks","operate","under","the","assumption","that","`","last_evaluation_results","`","will","be","updated","as","usual",",","so","restrict","usage","to","debugging","or",":","func",":","`","~hyperparameter_hunter.callbacks.bases.lambda_callback","`","implementations","Returns","--","--","--","-","_result",":","OrderedDict",",","or","list","A","dict","whose","keys","are","all","metric","keys","supplied","for","`","data_type","`",",","and","whose","values","are","the","results","of","each","metric",".","If","`","return_list","`","is","True",",","returns","a","list","of","tuples","of",":","(","<","`","data_type","`","metric","str",">",",","<","metric","result",">",")","Notes","--","--","-","The","required","types","of","`","target","`","and","`","prediction","`","are","entirely","dependent","on","the","metric","callable","'s","expectations"]
code: def evaluate(
      self,
      data_type,
      target,
      prediction,
      return_list=False,
      dry_run=False,
  ):
      """Apply metric(s) to the given data to calculate the value of the `prediction`
  
      Parameters
      ----------
      data_type: {"in_fold", "oof", "holdout"}
          The type of dataset for which `target` and `prediction` arguments are being provided
      target: Array-like
          True labels for the data. Should be same shape as `prediction`
      prediction: Array-like
          Predicted labels for the data. Should be same shape as `target`
      return_list: Boolean, default=False
          If True, return list of tuples instead of dict. See "Returns" section below for details
      dry_run: Boolean, default=False
          If True, the value of :attr:`last_evaluation_results` will not be updated to include
          the returned `_result`. The core library callbacks operate under the assumption that
          `last_evaluation_results` will be updated as usual, so restrict usage to debugging or
          :func:`~hyperparameter_hunter.callbacks.bases.lambda_callback` implementations
  
      Returns
      -------
      _result: OrderedDict, or list
          A dict whose keys are all metric keys supplied for `data_type`, and whose values are the
          results of each metric. If `return_list` is True, returns a list of tuples of:
          (<`data_type` metric str>, <metric result>)
  
      Notes
      -----
      The required types of `target` and `prediction` are entirely dependent on the metric
      callable's expectations"""
      if self.do_score is False:
          return
  
      _metric_ids = getattr(self, f"_ScoringMixIn__{data_type}")
      _result = []
      target = np.asarray(target)
      prediction = np.asarray(prediction)
  
      for _metric_id in _metric_ids:
          try:
              _metric_value = self.metrics[_metric_id](
                  target, prediction
              )
          except ValueError:
              # Check if target contains integer types, but prediction contains floats
              prediction = get_clean_prediction(target, prediction)
              _metric_value = self.metrics[_metric_id](
                  target, prediction
              )
  
          _result.append((_metric_id, _metric_value))
  
      _result = _result if return_list else OrderedDict(_result)
  
      if not dry_run:
          self.last_evaluation_results[data_type] = _result
  
      return _result
  
imports: from collections import OrderedDict
  from contextlib import suppress
  import numpy
  import pandas
  from typing import Dict, Iterable, List, Tuple, Union
  from sklearn import metrics
  from sklearn.utils.multiclass import type_of_target, unique_labels
label_desc: Use image node_id 3 for calling the ScoringMixIn obj's underlying member method code with example usage: obj.evaluate(data_type, target, prediction, return_list, dry_run) and returns: _result