code: def classify_output(target, prediction):
      """Force continuous `prediction` into the discrete, classified space of `target`.
      This is not an output/feature transformer akin to SKLearn's discretization transformers. This
      function is intended for use in the very specific case of having a `target` that is
      classification-like ("binary", "multiclass", etc.), with `prediction` that resembles a
      "continuous" target, despite being made for `target`. The most common reason for this occurrence
      is that `prediction` is actually the division-averaged predictions collected along the course
      of a :class:`~hyperparameter_hunter.experiments.CVExperiment`. In this case, the original model
      predictions should have been classification-like; however, due to disagreement in the division
      predictions, the resulting average predictions appear to be continuous
  
      Parameters
      ----------
      target: Array-like
          # TODO: ...
      prediction: Array-like
          # TODO: ...
  
      Returns
      -------
      numpy.array
          # TODO: ...
  
      Notes
      -----
      Target types used by this function are defined by `sklearn.utils.multiclass.type_of_target`.
  
      If a `prediction` value is exactly between two `target` values, it will assume the lower of the
      two values. For example, given a single prediction of 1.5 and unique `labels` of [0, 1, 2, 3],
      the value of that prediction will be 1, rather than 2
  
      Examples
      --------
      >>> import numpy as np
      >>> classify_output(np.array([0, 3, 1, 2]), [0.5, 1.51, 0.66, 4.9])
      array([0, 2, 1, 3])
      >>> classify_output(np.array([0, 1, 2, 3]), [0.5, 1.51, 0.66, 4.9])
      array([0, 2, 1, 3])
      >>> # TODO: ... Add more examples, including binary classification
      """
      # MARK: Might be ignoring 1-dimensional, label encodings, like 2nd case in `test_get_clean_prediction`:
      #   ([1, 0, 1, 0], [0.9, 0.1, 0.8, 0.2], [1.0, 0.0, 1.0, 0.0])
      labels = unique_labels(target)  # FLAG: ORIGINAL
      # labels = unique_labels(*target)  # FLAG: TEST
      return np.array(
          [labels[(np.abs(labels - _)).argmin()] for _ in prediction]
      )
  
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 5 for calling a global function with example usage: classify_output(target, prediction) and returns: np