code: def _get_outre_score_for_each_label(
      labels: np.ndarray,
      predictions: np.ndarray,
      *,
      residual_scale: float = 5,
      frac_neighbors: float = 0.5,
      neighbor_metric: str = "euclidean",
  ) -> np.ndarray:
      """Returns OUTRE based label-quality scores.
  
      This function computes label-quality scores for regression datasets,
      where a lower score indicates labels that are less likely to be correct.
  
      Parameters
      ----------
      labels: np.ndarray
          Labels in the same format as expected by the `~cleanlab.regression.rank.get_label_quality_scores` function.
  
      predictions: np.ndarray
          Predicted labels in the same format as expected by the `~cleanlab.regression.rank.get_label_quality_scores` function.
  
      residual_scale: float, default = 5
          Multiplicative factor to adjust scale (standard deviation) of the residuals relative to the labels.
  
      frac_neighbors: float, default = 0.5
          Fraction of examples in dataset that should be considered as `n_neighbors` in the ``NearestNeighbors`` object used internally to assess outliers.
  
      neighbor_metric: str, default = "euclidean"
          The parameter is passed to sklearn NearestNeighbors. # TODO add reference to sklearn.NearestNeighbor?
  
      Returns
      -------
      label_quality_scores: np.ndarray
          Contains one score (between 0 and 1) per example.
          Lower scores indicate more likely mislabled examples.
      """
      residual = predictions - labels
      labels = (labels - labels.mean()) / (labels.std() + TINY_VALUE)
      residual = residual_scale * (
          (residual - residual.mean()) / (residual.std() + TINY_VALUE)
      )
  
      # 2D features by combining labels and residual
      features = np.array([labels, residual]).T
  
      neighbors = int(np.ceil(frac_neighbors * labels.shape[0]))
      knn = NearestNeighbors(
          n_neighbors=neighbors, metric=neighbor_metric
      ).fit(features)
      ood = OutOfDistribution(params={"knn": knn})
  
      label_quality_scores = ood.score(features=features)
      return label_quality_scores
  
file_path: cleanlab/cleanlab/regression/rank.py
imports: from typing import Dict, Callable
  import numpy
  from numpy.typing import ArrayLike
  from sklearn.neighbors import NearestNeighbors
  from cleanlab.outlier import OutOfDistribution
  from cleanlab.internal.regression_utils import assert_valid_prediction_inputs
  from cleanlab.internal.constants import TINY_VALUE
label_desc: Use image node_id 3 for calling a global function with example usage: _get_outre_score_for_each_label(labels, predictions) and returns: label_quality_scores